0s autopkgtest [11:49:45]: starting date and time: 2025-11-17 11:49:45+0000 0s autopkgtest [11:49:45]: git checkout: 4b346b80 nova: make wait_reboot return success even when a no-op 0s autopkgtest [11:49:45]: host juju-7f2275-prod-proposed-migration-environment-2; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.vrlqx89z/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-cpu2-ram4-disk20-amd64 --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-2@sto01-7.secgroup --name adt-resolute-amd64-astroid-20251117-114945-juju-7f2275-prod-proposed-migration-environment-2-6775c8ea-02de-4886-ace3-26d7629c56d1 --image adt/ubuntu-resolute-amd64-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-2 --net-id=net_prod-autopkgtest-workers-amd64 -e TERM=linux --mirror=http://ftpmaster.internal/ubuntu/ 4s Creating nova instance adt-resolute-amd64-astroid-20251117-114945-juju-7f2275-prod-proposed-migration-environment-2-6775c8ea-02de-4886-ace3-26d7629c56d1 from image adt/ubuntu-resolute-amd64-server-20251117.img (UUID 9762b0cc-7c5b-4854-acd5-cc74ad0de8c6)... 45s autopkgtest [11:50:30]: testbed dpkg architecture: amd64 45s autopkgtest [11:50:30]: testbed apt version: 3.1.11 46s autopkgtest [11:50:31]: @@@@@@@@@@@@@@@@@@@@ test bed setup 46s autopkgtest [11:50:31]: testbed release detected to be: None 47s autopkgtest [11:50:32]: updating testbed package index (apt update) 47s Get:1 http://ftpmaster.internal/ubuntu resolute-proposed InRelease [87.8 kB] 47s Hit:2 http://ftpmaster.internal/ubuntu resolute InRelease 47s Hit:3 http://ftpmaster.internal/ubuntu resolute-updates InRelease 47s Hit:4 http://ftpmaster.internal/ubuntu resolute-security InRelease 47s Get:5 http://ftpmaster.internal/ubuntu resolute-proposed/restricted Sources [9848 B] 47s Get:6 http://ftpmaster.internal/ubuntu resolute-proposed/universe Sources [868 kB] 47s Get:7 http://ftpmaster.internal/ubuntu resolute-proposed/multiverse Sources [22.9 kB] 47s Get:8 http://ftpmaster.internal/ubuntu resolute-proposed/main Sources [81.1 kB] 47s Get:9 http://ftpmaster.internal/ubuntu resolute-proposed/main amd64 Packages [159 kB] 47s Get:10 http://ftpmaster.internal/ubuntu resolute-proposed/main i386 Packages [118 kB] 47s Get:11 http://ftpmaster.internal/ubuntu resolute-proposed/main amd64 c-n-f Metadata [3096 B] 47s Get:12 http://ftpmaster.internal/ubuntu resolute-proposed/restricted amd64 Packages [64.6 kB] 47s Get:13 http://ftpmaster.internal/ubuntu resolute-proposed/restricted i386 Packages [3744 B] 47s Get:14 http://ftpmaster.internal/ubuntu resolute-proposed/restricted amd64 c-n-f Metadata [336 B] 47s Get:15 http://ftpmaster.internal/ubuntu resolute-proposed/universe amd64 Packages [607 kB] 47s Get:16 http://ftpmaster.internal/ubuntu resolute-proposed/universe i386 Packages [279 kB] 48s Get:17 http://ftpmaster.internal/ubuntu resolute-proposed/universe amd64 c-n-f Metadata [21.2 kB] 48s Get:18 http://ftpmaster.internal/ubuntu resolute-proposed/multiverse amd64 Packages [13.4 kB] 48s Get:19 http://ftpmaster.internal/ubuntu resolute-proposed/multiverse i386 Packages [6516 B] 48s Get:20 http://ftpmaster.internal/ubuntu resolute-proposed/multiverse amd64 c-n-f Metadata [680 B] 49s Fetched 2346 kB in 1s (2432 kB/s) 50s Reading package lists... 50s Hit:1 http://ftpmaster.internal/ubuntu resolute-proposed InRelease 50s Hit:2 http://ftpmaster.internal/ubuntu resolute InRelease 50s Hit:3 http://ftpmaster.internal/ubuntu resolute-updates InRelease 50s Hit:4 http://ftpmaster.internal/ubuntu resolute-security InRelease 51s Reading package lists... 51s Reading package lists... 51s Building dependency tree... 51s Reading state information... 51s Calculating upgrade... 51s The following packages will be upgraded: 51s libpython3-stdlib python3 python3-minimal usbutils 51s 4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 51s Need to get 146 kB of archives. 51s After this operation, 0 B of additional disk space will be used. 51s Get:1 http://ftpmaster.internal/ubuntu resolute-proposed/main amd64 python3-minimal amd64 3.13.7-2 [27.8 kB] 51s Get:2 http://ftpmaster.internal/ubuntu resolute-proposed/main amd64 python3 amd64 3.13.7-2 [23.9 kB] 51s Get:3 http://ftpmaster.internal/ubuntu resolute-proposed/main amd64 libpython3-stdlib amd64 3.13.7-2 [10.6 kB] 51s Get:4 http://ftpmaster.internal/ubuntu resolute/main amd64 usbutils amd64 1:019-1 [83.9 kB] 51s dpkg-preconfigure: unable to re-open stdin: No such file or directory 51s Fetched 146 kB in 0s (0 B/s) 51s (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 ... 83372 files and directories currently installed.) 51s Preparing to unpack .../python3-minimal_3.13.7-2_amd64.deb ... 51s Unpacking python3-minimal (3.13.7-2) over (3.13.7-1) ... 51s Setting up python3-minimal (3.13.7-2) ... 52s (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 ... 83372 files and directories currently installed.) 52s Preparing to unpack .../python3_3.13.7-2_amd64.deb ... 52s running python pre-rtupdate hooks for python3.13... 52s Unpacking python3 (3.13.7-2) over (3.13.7-1) ... 52s Preparing to unpack .../libpython3-stdlib_3.13.7-2_amd64.deb ... 52s Unpacking libpython3-stdlib:amd64 (3.13.7-2) over (3.13.7-1) ... 52s Preparing to unpack .../usbutils_1%3a019-1_amd64.deb ... 52s Unpacking usbutils (1:019-1) over (1:018-2) ... 52s Setting up usbutils (1:019-1) ... 52s Setting up libpython3-stdlib:amd64 (3.13.7-2) ... 52s Setting up python3 (3.13.7-2) ... 52s running python rtupdate hooks for python3.13... 52s running python post-rtupdate hooks for python3.13... 52s Processing triggers for man-db (2.13.1-1) ... 52s autopkgtest [11:50:37]: upgrading testbed (apt dist-upgrade and autopurge) 53s Reading package lists... 53s Building dependency tree... 53s Reading state information... 53s Calculating upgrade... 53s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 53s Reading package lists... 53s Building dependency tree... 53s Reading state information... 53s Solving dependencies... 53s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 55s autopkgtest [11:50:40]: testbed running kernel: Linux 6.17.0-5-generic #5-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep 22 10:00:33 UTC 2025 56s autopkgtest [11:50:41]: @@@@@@@@@@@@@@@@@@@@ apt-source astroid 57s Get:1 http://ftpmaster.internal/ubuntu resolute/universe astroid 3.3.8-2 (dsc) [2268 B] 57s Get:2 http://ftpmaster.internal/ubuntu resolute/universe astroid 3.3.8-2 (tar) [467 kB] 57s Get:3 http://ftpmaster.internal/ubuntu resolute/universe astroid 3.3.8-2 (diff) [5604 B] 57s gpgv: Signature made Sun Jan 19 13:16:35 2025 UTC 57s gpgv: using RSA key 8F6DE104377F3B11E741748731F3144544A1741A 57s gpgv: issuer "tchet@debian.org" 57s gpgv: Can't check signature: No public key 57s dpkg-source: warning: cannot verify inline signature for ./astroid_3.3.8-2.dsc: no acceptable signature found 57s autopkgtest [11:50:42]: testing package astroid version 3.3.8-2 57s autopkgtest [11:50:42]: build not needed 58s autopkgtest [11:50:43]: test pybuild-autopkgtest: preparing testbed 58s Reading package lists... 58s Building dependency tree... 58s Reading state information... 58s Solving dependencies... 58s The following NEW packages will be installed: 58s autoconf automake autopoint autotools-dev build-essential cpp cpp-15 58s cpp-15-x86-64-linux-gnu cpp-x86-64-linux-gnu debhelper debugedit 58s dh-autoreconf dh-python dh-strip-nondeterminism dwz g++ g++-15 58s g++-15-x86-64-linux-gnu g++-x86-64-linux-gnu gcc gcc-15 58s gcc-15-x86-64-linux-gnu gcc-x86-64-linux-gnu gettext intltool-debian 58s libarchive-zip-perl libasan8 libcc1-0 libdebhelper-perl 58s libfile-stripnondeterminism-perl libgcc-15-dev libgomp1 libhwasan0 libisl23 58s libitm1 liblsan0 libmpc3 libpython3.14-minimal libpython3.14-stdlib 58s libquadmath0 libstdc++-15-dev libtool libtsan2 libubsan1 m4 po-debconf 58s pybuild-plugin-autopkgtest pybuild-plugin-pyproject python3-all 58s python3-astroid python3-build python3-iniconfig python3-installer 58s python3-lazy-object-proxy python3-pip python3-pluggy python3-pyproject-hooks 58s python3-pytest python3-pytest-runner python3-wheel python3-wrapt python3.14 58s python3.14-minimal 58s 0 upgraded, 63 newly installed, 0 to remove and 0 not upgraded. 58s Need to get 83.4 MB of archives. 58s After this operation, 289 MB of additional disk space will be used. 58s Get:1 http://ftpmaster.internal/ubuntu resolute/main amd64 libpython3.14-minimal amd64 3.14.0-4 [906 kB] 58s Get:2 http://ftpmaster.internal/ubuntu resolute/main amd64 python3.14-minimal amd64 3.14.0-4 [2559 kB] 59s Get:3 http://ftpmaster.internal/ubuntu resolute/main amd64 m4 amd64 1.4.20-2 [217 kB] 59s Get:4 http://ftpmaster.internal/ubuntu resolute/main amd64 autoconf all 2.72-3.1ubuntu1 [384 kB] 59s Get:5 http://ftpmaster.internal/ubuntu resolute/main amd64 autotools-dev all 20240727.1 [43.4 kB] 59s Get:6 http://ftpmaster.internal/ubuntu resolute/main amd64 automake all 1:1.18.1-2 [581 kB] 59s Get:7 http://ftpmaster.internal/ubuntu resolute/main amd64 autopoint all 0.23.2-1 [620 kB] 59s Get:8 http://ftpmaster.internal/ubuntu resolute/main amd64 libisl23 amd64 0.27-1 [685 kB] 59s Get:9 http://ftpmaster.internal/ubuntu resolute/main amd64 libmpc3 amd64 1.3.1-2 [54.8 kB] 59s Get:10 http://ftpmaster.internal/ubuntu resolute/main amd64 cpp-15-x86-64-linux-gnu amd64 15.2.0-7ubuntu1 [12.9 MB] 59s Get:11 http://ftpmaster.internal/ubuntu resolute/main amd64 cpp-15 amd64 15.2.0-7ubuntu1 [1026 B] 59s Get:12 http://ftpmaster.internal/ubuntu resolute/main amd64 cpp-x86-64-linux-gnu amd64 4:15.2.0-4ubuntu1 [5746 B] 59s Get:13 http://ftpmaster.internal/ubuntu resolute/main amd64 cpp amd64 4:15.2.0-4ubuntu1 [22.4 kB] 59s Get:14 http://ftpmaster.internal/ubuntu resolute/main amd64 libcc1-0 amd64 15.2.0-7ubuntu1 [47.4 kB] 59s Get:15 http://ftpmaster.internal/ubuntu resolute/main amd64 libgomp1 amd64 15.2.0-7ubuntu1 [151 kB] 59s Get:16 http://ftpmaster.internal/ubuntu resolute/main amd64 libitm1 amd64 15.2.0-7ubuntu1 [29.7 kB] 59s Get:17 http://ftpmaster.internal/ubuntu resolute/main amd64 libasan8 amd64 15.2.0-7ubuntu1 [3071 kB] 59s Get:18 http://ftpmaster.internal/ubuntu resolute/main amd64 liblsan0 amd64 15.2.0-7ubuntu1 [1360 kB] 59s Get:19 http://ftpmaster.internal/ubuntu resolute/main amd64 libtsan2 amd64 15.2.0-7ubuntu1 [2757 kB] 59s Get:20 http://ftpmaster.internal/ubuntu resolute/main amd64 libubsan1 amd64 15.2.0-7ubuntu1 [1210 kB] 59s Get:21 http://ftpmaster.internal/ubuntu resolute/main amd64 libhwasan0 amd64 15.2.0-7ubuntu1 [1685 kB] 59s Get:22 http://ftpmaster.internal/ubuntu resolute/main amd64 libquadmath0 amd64 15.2.0-7ubuntu1 [153 kB] 60s Get:23 http://ftpmaster.internal/ubuntu resolute/main amd64 libgcc-15-dev amd64 15.2.0-7ubuntu1 [2864 kB] 60s Get:24 http://ftpmaster.internal/ubuntu resolute/main amd64 gcc-15-x86-64-linux-gnu amd64 15.2.0-7ubuntu1 [25.4 MB] 60s Get:25 http://ftpmaster.internal/ubuntu resolute/main amd64 gcc-15 amd64 15.2.0-7ubuntu1 [524 kB] 60s Get:26 http://ftpmaster.internal/ubuntu resolute/main amd64 gcc-x86-64-linux-gnu amd64 4:15.2.0-4ubuntu1 [1208 B] 60s Get:27 http://ftpmaster.internal/ubuntu resolute/main amd64 gcc amd64 4:15.2.0-4ubuntu1 [5024 B] 60s Get:28 http://ftpmaster.internal/ubuntu resolute/main amd64 libstdc++-15-dev amd64 15.2.0-7ubuntu1 [2573 kB] 60s Get:29 http://ftpmaster.internal/ubuntu resolute/main amd64 g++-15-x86-64-linux-gnu amd64 15.2.0-7ubuntu1 [14.4 MB] 61s Get:30 http://ftpmaster.internal/ubuntu resolute/main amd64 g++-15 amd64 15.2.0-7ubuntu1 [23.7 kB] 61s Get:31 http://ftpmaster.internal/ubuntu resolute/main amd64 g++-x86-64-linux-gnu amd64 4:15.2.0-4ubuntu1 [966 B] 61s Get:32 http://ftpmaster.internal/ubuntu resolute/main amd64 g++ amd64 4:15.2.0-4ubuntu1 [1100 B] 61s Get:33 http://ftpmaster.internal/ubuntu resolute/main amd64 build-essential amd64 12.12ubuntu1 [5080 B] 61s Get:34 http://ftpmaster.internal/ubuntu resolute/main amd64 libdebhelper-perl all 13.24.2ubuntu1 [95.7 kB] 61s Get:35 http://ftpmaster.internal/ubuntu resolute/main amd64 libtool all 2.5.4-7 [169 kB] 61s Get:36 http://ftpmaster.internal/ubuntu resolute/main amd64 dh-autoreconf all 21 [12.5 kB] 61s Get:37 http://ftpmaster.internal/ubuntu resolute/main amd64 libarchive-zip-perl all 1.68-1 [90.2 kB] 61s Get:38 http://ftpmaster.internal/ubuntu resolute/main amd64 libfile-stripnondeterminism-perl all 1.15.0-1 [20.5 kB] 61s Get:39 http://ftpmaster.internal/ubuntu resolute/main amd64 dh-strip-nondeterminism all 1.15.0-1 [5090 B] 61s Get:40 http://ftpmaster.internal/ubuntu resolute/main amd64 debugedit amd64 1:5.2-3 [49.9 kB] 61s Get:41 http://ftpmaster.internal/ubuntu resolute/main amd64 dwz amd64 0.16-2 [115 kB] 61s Get:42 http://ftpmaster.internal/ubuntu resolute/main amd64 gettext amd64 0.23.2-1 [1019 kB] 61s Get:43 http://ftpmaster.internal/ubuntu resolute/main amd64 intltool-debian all 0.35.0+20060710.6 [23.2 kB] 61s Get:44 http://ftpmaster.internal/ubuntu resolute/main amd64 po-debconf all 1.0.21+nmu1 [233 kB] 61s Get:45 http://ftpmaster.internal/ubuntu resolute/main amd64 debhelper all 13.24.2ubuntu1 [896 kB] 61s Get:46 http://ftpmaster.internal/ubuntu resolute/universe amd64 dh-python all 6.20250414 [119 kB] 61s Get:47 http://ftpmaster.internal/ubuntu resolute/main amd64 libpython3.14-stdlib amd64 3.14.0-4 [2397 kB] 61s Get:48 http://ftpmaster.internal/ubuntu resolute/universe amd64 pybuild-plugin-autopkgtest all 6.20250414 [1746 B] 61s Get:49 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-pyproject-hooks all 1.2.0-1 [10.2 kB] 61s Get:50 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-wheel all 0.46.1-2 [22.1 kB] 61s Get:51 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-build all 1.2.2-4 [31.0 kB] 61s Get:52 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-installer all 0.7.0+dfsg1-3 [17.4 kB] 61s Get:53 http://ftpmaster.internal/ubuntu resolute/universe amd64 pybuild-plugin-pyproject all 6.20250414 [1728 B] 61s Get:54 http://ftpmaster.internal/ubuntu resolute/main amd64 python3.14 amd64 3.14.0-4 [805 kB] 61s Get:55 http://ftpmaster.internal/ubuntu resolute-proposed/main amd64 python3-all amd64 3.13.7-2 [890 B] 61s Get:56 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-astroid all 3.3.8-2 [175 kB] 61s Get:57 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-iniconfig all 2.1.0-1 [6840 B] 61s Get:58 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-lazy-object-proxy amd64 1.12.0-1 [26.8 kB] 61s Get:59 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-pip all 25.1.1+dfsg-1ubuntu2 [1416 kB] 61s Get:60 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-pluggy all 1.6.0-1 [21.0 kB] 61s Get:61 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-pytest all 8.3.5-2 [252 kB] 61s Get:62 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-pytest-runner all 2.11.1-5 [7592 B] 61s Get:63 http://ftpmaster.internal/ubuntu resolute/main amd64 python3-wrapt amd64 1.17.3-2 [40.7 kB] 61s Fetched 83.4 MB in 3s (31.5 MB/s) 61s Selecting previously unselected package libpython3.14-minimal:amd64. 61s (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 ... 83372 files and directories currently installed.) 61s Preparing to unpack .../00-libpython3.14-minimal_3.14.0-4_amd64.deb ... 61s Unpacking libpython3.14-minimal:amd64 (3.14.0-4) ... 61s Selecting previously unselected package python3.14-minimal. 61s Preparing to unpack .../01-python3.14-minimal_3.14.0-4_amd64.deb ... 61s Unpacking python3.14-minimal (3.14.0-4) ... 61s Selecting previously unselected package m4. 61s Preparing to unpack .../02-m4_1.4.20-2_amd64.deb ... 61s Unpacking m4 (1.4.20-2) ... 61s Selecting previously unselected package autoconf. 61s Preparing to unpack .../03-autoconf_2.72-3.1ubuntu1_all.deb ... 61s Unpacking autoconf (2.72-3.1ubuntu1) ... 61s Selecting previously unselected package autotools-dev. 61s Preparing to unpack .../04-autotools-dev_20240727.1_all.deb ... 61s Unpacking autotools-dev (20240727.1) ... 61s Selecting previously unselected package automake. 61s Preparing to unpack .../05-automake_1%3a1.18.1-2_all.deb ... 61s Unpacking automake (1:1.18.1-2) ... 61s Selecting previously unselected package autopoint. 61s Preparing to unpack .../06-autopoint_0.23.2-1_all.deb ... 61s Unpacking autopoint (0.23.2-1) ... 61s Selecting previously unselected package libisl23:amd64. 61s Preparing to unpack .../07-libisl23_0.27-1_amd64.deb ... 61s Unpacking libisl23:amd64 (0.27-1) ... 61s Selecting previously unselected package libmpc3:amd64. 61s Preparing to unpack .../08-libmpc3_1.3.1-2_amd64.deb ... 61s Unpacking libmpc3:amd64 (1.3.1-2) ... 61s Selecting previously unselected package cpp-15-x86-64-linux-gnu. 61s Preparing to unpack .../09-cpp-15-x86-64-linux-gnu_15.2.0-7ubuntu1_amd64.deb ... 61s Unpacking cpp-15-x86-64-linux-gnu (15.2.0-7ubuntu1) ... 61s Selecting previously unselected package cpp-15. 61s Preparing to unpack .../10-cpp-15_15.2.0-7ubuntu1_amd64.deb ... 61s Unpacking cpp-15 (15.2.0-7ubuntu1) ... 61s Selecting previously unselected package cpp-x86-64-linux-gnu. 61s Preparing to unpack .../11-cpp-x86-64-linux-gnu_4%3a15.2.0-4ubuntu1_amd64.deb ... 61s Unpacking cpp-x86-64-linux-gnu (4:15.2.0-4ubuntu1) ... 61s Selecting previously unselected package cpp. 61s Preparing to unpack .../12-cpp_4%3a15.2.0-4ubuntu1_amd64.deb ... 61s Unpacking cpp (4:15.2.0-4ubuntu1) ... 61s Selecting previously unselected package libcc1-0:amd64. 61s Preparing to unpack .../13-libcc1-0_15.2.0-7ubuntu1_amd64.deb ... 61s Unpacking libcc1-0:amd64 (15.2.0-7ubuntu1) ... 61s Selecting previously unselected package libgomp1:amd64. 61s Preparing to unpack .../14-libgomp1_15.2.0-7ubuntu1_amd64.deb ... 61s Unpacking libgomp1:amd64 (15.2.0-7ubuntu1) ... 61s Selecting previously unselected package libitm1:amd64. 61s Preparing to unpack .../15-libitm1_15.2.0-7ubuntu1_amd64.deb ... 61s Unpacking libitm1:amd64 (15.2.0-7ubuntu1) ... 61s Selecting previously unselected package libasan8:amd64. 61s Preparing to unpack .../16-libasan8_15.2.0-7ubuntu1_amd64.deb ... 61s Unpacking libasan8:amd64 (15.2.0-7ubuntu1) ... 62s Selecting previously unselected package liblsan0:amd64. 62s Preparing to unpack .../17-liblsan0_15.2.0-7ubuntu1_amd64.deb ... 62s Unpacking liblsan0:amd64 (15.2.0-7ubuntu1) ... 62s Selecting previously unselected package libtsan2:amd64. 62s Preparing to unpack .../18-libtsan2_15.2.0-7ubuntu1_amd64.deb ... 62s Unpacking libtsan2:amd64 (15.2.0-7ubuntu1) ... 62s Selecting previously unselected package libubsan1:amd64. 62s Preparing to unpack .../19-libubsan1_15.2.0-7ubuntu1_amd64.deb ... 62s Unpacking libubsan1:amd64 (15.2.0-7ubuntu1) ... 62s Selecting previously unselected package libhwasan0:amd64. 62s Preparing to unpack .../20-libhwasan0_15.2.0-7ubuntu1_amd64.deb ... 62s Unpacking libhwasan0:amd64 (15.2.0-7ubuntu1) ... 62s Selecting previously unselected package libquadmath0:amd64. 62s Preparing to unpack .../21-libquadmath0_15.2.0-7ubuntu1_amd64.deb ... 62s Unpacking libquadmath0:amd64 (15.2.0-7ubuntu1) ... 62s Selecting previously unselected package libgcc-15-dev:amd64. 62s Preparing to unpack .../22-libgcc-15-dev_15.2.0-7ubuntu1_amd64.deb ... 62s Unpacking libgcc-15-dev:amd64 (15.2.0-7ubuntu1) ... 62s Selecting previously unselected package gcc-15-x86-64-linux-gnu. 62s Preparing to unpack .../23-gcc-15-x86-64-linux-gnu_15.2.0-7ubuntu1_amd64.deb ... 62s Unpacking gcc-15-x86-64-linux-gnu (15.2.0-7ubuntu1) ... 62s Selecting previously unselected package gcc-15. 62s Preparing to unpack .../24-gcc-15_15.2.0-7ubuntu1_amd64.deb ... 62s Unpacking gcc-15 (15.2.0-7ubuntu1) ... 62s Selecting previously unselected package gcc-x86-64-linux-gnu. 62s Preparing to unpack .../25-gcc-x86-64-linux-gnu_4%3a15.2.0-4ubuntu1_amd64.deb ... 62s Unpacking gcc-x86-64-linux-gnu (4:15.2.0-4ubuntu1) ... 62s Selecting previously unselected package gcc. 62s Preparing to unpack .../26-gcc_4%3a15.2.0-4ubuntu1_amd64.deb ... 62s Unpacking gcc (4:15.2.0-4ubuntu1) ... 62s Selecting previously unselected package libstdc++-15-dev:amd64. 62s Preparing to unpack .../27-libstdc++-15-dev_15.2.0-7ubuntu1_amd64.deb ... 62s Unpacking libstdc++-15-dev:amd64 (15.2.0-7ubuntu1) ... 62s Selecting previously unselected package g++-15-x86-64-linux-gnu. 62s Preparing to unpack .../28-g++-15-x86-64-linux-gnu_15.2.0-7ubuntu1_amd64.deb ... 62s Unpacking g++-15-x86-64-linux-gnu (15.2.0-7ubuntu1) ... 62s Selecting previously unselected package g++-15. 62s Preparing to unpack .../29-g++-15_15.2.0-7ubuntu1_amd64.deb ... 62s Unpacking g++-15 (15.2.0-7ubuntu1) ... 62s Selecting previously unselected package g++-x86-64-linux-gnu. 62s Preparing to unpack .../30-g++-x86-64-linux-gnu_4%3a15.2.0-4ubuntu1_amd64.deb ... 62s Unpacking g++-x86-64-linux-gnu (4:15.2.0-4ubuntu1) ... 62s Selecting previously unselected package g++. 62s Preparing to unpack .../31-g++_4%3a15.2.0-4ubuntu1_amd64.deb ... 62s Unpacking g++ (4:15.2.0-4ubuntu1) ... 62s Selecting previously unselected package build-essential. 62s Preparing to unpack .../32-build-essential_12.12ubuntu1_amd64.deb ... 62s Unpacking build-essential (12.12ubuntu1) ... 62s Selecting previously unselected package libdebhelper-perl. 62s Preparing to unpack .../33-libdebhelper-perl_13.24.2ubuntu1_all.deb ... 62s Unpacking libdebhelper-perl (13.24.2ubuntu1) ... 62s Selecting previously unselected package libtool. 62s Preparing to unpack .../34-libtool_2.5.4-7_all.deb ... 62s Unpacking libtool (2.5.4-7) ... 62s Selecting previously unselected package dh-autoreconf. 62s Preparing to unpack .../35-dh-autoreconf_21_all.deb ... 62s Unpacking dh-autoreconf (21) ... 62s Selecting previously unselected package libarchive-zip-perl. 62s Preparing to unpack .../36-libarchive-zip-perl_1.68-1_all.deb ... 62s Unpacking libarchive-zip-perl (1.68-1) ... 62s Selecting previously unselected package libfile-stripnondeterminism-perl. 62s Preparing to unpack .../37-libfile-stripnondeterminism-perl_1.15.0-1_all.deb ... 62s Unpacking libfile-stripnondeterminism-perl (1.15.0-1) ... 62s Selecting previously unselected package dh-strip-nondeterminism. 62s Preparing to unpack .../38-dh-strip-nondeterminism_1.15.0-1_all.deb ... 62s Unpacking dh-strip-nondeterminism (1.15.0-1) ... 62s Selecting previously unselected package debugedit. 62s Preparing to unpack .../39-debugedit_1%3a5.2-3_amd64.deb ... 62s Unpacking debugedit (1:5.2-3) ... 62s Selecting previously unselected package dwz. 62s Preparing to unpack .../40-dwz_0.16-2_amd64.deb ... 62s Unpacking dwz (0.16-2) ... 62s Selecting previously unselected package gettext. 62s Preparing to unpack .../41-gettext_0.23.2-1_amd64.deb ... 62s Unpacking gettext (0.23.2-1) ... 62s Selecting previously unselected package intltool-debian. 62s Preparing to unpack .../42-intltool-debian_0.35.0+20060710.6_all.deb ... 62s Unpacking intltool-debian (0.35.0+20060710.6) ... 62s Selecting previously unselected package po-debconf. 62s Preparing to unpack .../43-po-debconf_1.0.21+nmu1_all.deb ... 62s Unpacking po-debconf (1.0.21+nmu1) ... 62s Selecting previously unselected package debhelper. 62s Preparing to unpack .../44-debhelper_13.24.2ubuntu1_all.deb ... 62s Unpacking debhelper (13.24.2ubuntu1) ... 62s Selecting previously unselected package dh-python. 62s Preparing to unpack .../45-dh-python_6.20250414_all.deb ... 62s Unpacking dh-python (6.20250414) ... 62s Selecting previously unselected package libpython3.14-stdlib:amd64. 62s Preparing to unpack .../46-libpython3.14-stdlib_3.14.0-4_amd64.deb ... 62s Unpacking libpython3.14-stdlib:amd64 (3.14.0-4) ... 62s Selecting previously unselected package pybuild-plugin-autopkgtest. 62s Preparing to unpack .../47-pybuild-plugin-autopkgtest_6.20250414_all.deb ... 62s Unpacking pybuild-plugin-autopkgtest (6.20250414) ... 62s Selecting previously unselected package python3-pyproject-hooks. 62s Preparing to unpack .../48-python3-pyproject-hooks_1.2.0-1_all.deb ... 62s Unpacking python3-pyproject-hooks (1.2.0-1) ... 62s Selecting previously unselected package python3-wheel. 62s Preparing to unpack .../49-python3-wheel_0.46.1-2_all.deb ... 62s Unpacking python3-wheel (0.46.1-2) ... 62s Selecting previously unselected package python3-build. 62s Preparing to unpack .../50-python3-build_1.2.2-4_all.deb ... 62s Unpacking python3-build (1.2.2-4) ... 62s Selecting previously unselected package python3-installer. 62s Preparing to unpack .../51-python3-installer_0.7.0+dfsg1-3_all.deb ... 62s Unpacking python3-installer (0.7.0+dfsg1-3) ... 62s Selecting previously unselected package pybuild-plugin-pyproject. 62s Preparing to unpack .../52-pybuild-plugin-pyproject_6.20250414_all.deb ... 62s Unpacking pybuild-plugin-pyproject (6.20250414) ... 62s Selecting previously unselected package python3.14. 62s Preparing to unpack .../53-python3.14_3.14.0-4_amd64.deb ... 62s Unpacking python3.14 (3.14.0-4) ... 62s Selecting previously unselected package python3-all. 62s Preparing to unpack .../54-python3-all_3.13.7-2_amd64.deb ... 62s Unpacking python3-all (3.13.7-2) ... 62s Selecting previously unselected package python3-astroid. 62s Preparing to unpack .../55-python3-astroid_3.3.8-2_all.deb ... 62s Unpacking python3-astroid (3.3.8-2) ... 62s Selecting previously unselected package python3-iniconfig. 62s Preparing to unpack .../56-python3-iniconfig_2.1.0-1_all.deb ... 62s Unpacking python3-iniconfig (2.1.0-1) ... 63s Selecting previously unselected package python3-lazy-object-proxy. 63s Preparing to unpack .../57-python3-lazy-object-proxy_1.12.0-1_amd64.deb ... 63s Unpacking python3-lazy-object-proxy (1.12.0-1) ... 63s Selecting previously unselected package python3-pip. 63s Preparing to unpack .../58-python3-pip_25.1.1+dfsg-1ubuntu2_all.deb ... 63s Unpacking python3-pip (25.1.1+dfsg-1ubuntu2) ... 63s Selecting previously unselected package python3-pluggy. 63s Preparing to unpack .../59-python3-pluggy_1.6.0-1_all.deb ... 63s Unpacking python3-pluggy (1.6.0-1) ... 63s Selecting previously unselected package python3-pytest. 63s Preparing to unpack .../60-python3-pytest_8.3.5-2_all.deb ... 63s Unpacking python3-pytest (8.3.5-2) ... 63s Selecting previously unselected package python3-pytest-runner. 63s Preparing to unpack .../61-python3-pytest-runner_2.11.1-5_all.deb ... 63s Unpacking python3-pytest-runner (2.11.1-5) ... 63s Selecting previously unselected package python3-wrapt. 63s Preparing to unpack .../62-python3-wrapt_1.17.3-2_amd64.deb ... 63s Unpacking python3-wrapt (1.17.3-2) ... 63s Setting up dh-python (6.20250414) ... 63s Setting up python3-iniconfig (2.1.0-1) ... 63s Setting up libarchive-zip-perl (1.68-1) ... 63s Setting up libdebhelper-perl (13.24.2ubuntu1) ... 63s Setting up libpython3.14-minimal:amd64 (3.14.0-4) ... 63s Setting up m4 (1.4.20-2) ... 63s Setting up libgomp1:amd64 (15.2.0-7ubuntu1) ... 63s Setting up python3-wheel (0.46.1-2) ... 63s Setting up autotools-dev (20240727.1) ... 63s Setting up python3-pyproject-hooks (1.2.0-1) ... 63s Setting up libquadmath0:amd64 (15.2.0-7ubuntu1) ... 63s Setting up libmpc3:amd64 (1.3.1-2) ... 63s Setting up python3-wrapt (1.17.3-2) ... 63s Setting up autopoint (0.23.2-1) ... 63s Setting up python3-pip (25.1.1+dfsg-1ubuntu2) ... 64s Setting up python3-installer (0.7.0+dfsg1-3) ... 65s Setting up autoconf (2.72-3.1ubuntu1) ... 65s Setting up python3-pluggy (1.6.0-1) ... 65s Setting up libubsan1:amd64 (15.2.0-7ubuntu1) ... 65s Setting up dwz (0.16-2) ... 65s Setting up python3-astroid (3.3.8-2) ... 65s Setting up libhwasan0:amd64 (15.2.0-7ubuntu1) ... 65s Setting up libasan8:amd64 (15.2.0-7ubuntu1) ... 65s Setting up debugedit (1:5.2-3) ... 65s Setting up python3-pytest-runner (2.11.1-5) ... 65s Setting up libtsan2:amd64 (15.2.0-7ubuntu1) ... 65s Setting up python3-lazy-object-proxy (1.12.0-1) ... 65s Setting up libisl23:amd64 (0.27-1) ... 65s Setting up python3-build (1.2.2-4) ... 65s Setting up python3.14-minimal (3.14.0-4) ... 66s Setting up libcc1-0:amd64 (15.2.0-7ubuntu1) ... 66s Setting up liblsan0:amd64 (15.2.0-7ubuntu1) ... 66s Setting up libitm1:amd64 (15.2.0-7ubuntu1) ... 66s Setting up automake (1:1.18.1-2) ... 66s update-alternatives: using /usr/bin/automake-1.18 to provide /usr/bin/automake (automake) in auto mode 66s Setting up libfile-stripnondeterminism-perl (1.15.0-1) ... 66s Setting up gettext (0.23.2-1) ... 66s Setting up libgcc-15-dev:amd64 (15.2.0-7ubuntu1) ... 66s Setting up libpython3.14-stdlib:amd64 (3.14.0-4) ... 66s Setting up pybuild-plugin-pyproject (6.20250414) ... 66s Setting up python3-pytest (8.3.5-2) ... 66s Setting up cpp-15-x86-64-linux-gnu (15.2.0-7ubuntu1) ... 66s Setting up intltool-debian (0.35.0+20060710.6) ... 66s Setting up gcc-15-x86-64-linux-gnu (15.2.0-7ubuntu1) ... 66s Setting up libstdc++-15-dev:amd64 (15.2.0-7ubuntu1) ... 66s Setting up dh-strip-nondeterminism (1.15.0-1) ... 66s Setting up cpp-15 (15.2.0-7ubuntu1) ... 66s Setting up python3.14 (3.14.0-4) ... 67s Setting up cpp-x86-64-linux-gnu (4:15.2.0-4ubuntu1) ... 67s Setting up g++-15-x86-64-linux-gnu (15.2.0-7ubuntu1) ... 67s Setting up gcc-x86-64-linux-gnu (4:15.2.0-4ubuntu1) ... 67s Setting up po-debconf (1.0.21+nmu1) ... 67s Setting up python3-all (3.13.7-2) ... 67s Setting up gcc-15 (15.2.0-7ubuntu1) ... 67s Setting up cpp (4:15.2.0-4ubuntu1) ... 67s Setting up g++-x86-64-linux-gnu (4:15.2.0-4ubuntu1) ... 67s Setting up g++-15 (15.2.0-7ubuntu1) ... 67s Setting up libtool (2.5.4-7) ... 67s Setting up gcc (4:15.2.0-4ubuntu1) ... 67s Setting up dh-autoreconf (21) ... 67s Setting up g++ (4:15.2.0-4ubuntu1) ... 67s update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode 67s Setting up build-essential (12.12ubuntu1) ... 67s Setting up debhelper (13.24.2ubuntu1) ... 67s Setting up pybuild-plugin-autopkgtest (6.20250414) ... 67s Processing triggers for man-db (2.13.1-1) ... 67s Processing triggers for install-info (7.2-5) ... 67s Processing triggers for libc-bin (2.42-2ubuntu2) ... 67s Processing triggers for systemd (257.9-0ubuntu2) ... 68s autopkgtest [11:50:53]: test pybuild-autopkgtest: pybuild-autopkgtest 68s autopkgtest [11:50:53]: test pybuild-autopkgtest: [----------------------- 68s pybuild-autopkgtest 69s I: pybuild base:311: cd /tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build; python3.14 -m pytest tests 70s ============================= test session starts ============================== 70s platform linux -- Python 3.14.0, pytest-8.3.5, pluggy-1.6.0 70s rootdir: /tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build 70s configfile: pyproject.toml 70s plugins: typeguard-4.4.2 70s collected 1708 items 70s 70s tests/brain/numpy/test_core_einsumfunc.py ss [ 0%] 70s tests/brain/numpy/test_core_fromnumeric.py s [ 0%] 70s tests/brain/numpy/test_core_function_base.py s [ 0%] 70s tests/brain/numpy/test_core_multiarray.py sssss [ 0%] 70s tests/brain/numpy/test_core_numeric.py sssss [ 0%] 70s tests/brain/numpy/test_core_numerictypes.py sssssss.. [ 1%] 70s tests/brain/numpy/test_core_umath.py ssssssss [ 1%] 70s tests/brain/numpy/test_ma.py ssss [ 2%] 70s tests/brain/numpy/test_ndarray.py sss [ 2%] 70s tests/brain/numpy/test_random_mtrand.py ss [ 2%] 70s tests/brain/test_argparse.py . [ 2%] 70s tests/brain/test_attr.py ....... [ 2%] 71s tests/brain/test_brain.py ......s.....ss......F......................... [ 5%] 71s ..........F.s.........................................................x. [ 9%] 71s ..............s...... [ 10%] 71s tests/brain/test_builtin.py .................. [ 12%] 71s tests/brain/test_ctypes.py ....x........................ [ 13%] 71s tests/brain/test_dataclasses.py ........................................ [ 16%] 71s ......................................x... [ 18%] 71s tests/brain/test_dateutil.py . [ 18%] 71s tests/brain/test_enum.py ............................. [ 20%] 72s tests/brain/test_hashlib.py ... [ 20%] 72s tests/brain/test_multiprocessing.py ... [ 20%] 72s tests/brain/test_named_tuple.py ....................... [ 21%] 72s tests/brain/test_nose.py s [ 22%] 72s tests/brain/test_pathlib.py FF.. [ 22%] 72s tests/brain/test_pytest.py . [ 22%] 72s tests/brain/test_qt.py sss [ 22%] 72s tests/brain/test_regex.py ss [ 22%] 72s tests/brain/test_signal.py ... [ 22%] 72s tests/brain/test_six.py ....... [ 23%] 72s tests/brain/test_ssl.py .. [ 23%] 72s tests/brain/test_threading.py .... [ 23%] 73s tests/brain/test_typing.py ..... [ 23%] 73s tests/brain/test_typing_extensions.py . [ 23%] 73s tests/brain/test_unittest.py . [ 23%] 73s tests/test_builder.py ...........................................FFFFFFF [ 26%] 74s FFFF.... [ 27%] 74s tests/test_constraint.py ................................... [ 29%] 74s tests/test_decorators.py ... [ 29%] 74s tests/test_filter_statements.py . [ 29%] 74s tests/test_group_exceptions.py ... [ 29%] 74s tests/test_helpers.py ............... [ 30%] 74s tests/test_inference.py ............................................F... [ 33%] 74s ............................................x...........x......x........ [ 37%] 74s ..................................................x..................... [ 41%] 74s ........................................................................ [ 46%] 75s ................................................x........xx............. [ 50%] 75s ........x...x................................................x.......... [ 54%] 75s ................................. [ 56%] 75s tests/test_inference_calls.py ........................ [ 57%] 76s tests/test_lookup.py FFFFFFFFFFFFFFFFFFFFFFFFFFFF....................... [ 60%] 76s .... [ 61%] 82s tests/test_manager.py .....................................s....... [ 63%] 83s tests/test_modutils.py ................................................. [ 66%] 83s ................s. [ 67%] 83s tests/test_nodes.py ............F................FFFFFFFFF.............. [ 70%] 83s ........................................................................ [ 74%] 83s ................................................................ [ 78%] 83s tests/test_nodes_lineno.py ....................... [ 80%] 83s tests/test_nodes_position.py ... [ 80%] 83s tests/test_object_model.py x...............x.........s........... [ 82%] 83s tests/test_objects.py ...................... [ 83%] 83s tests/test_protocols.py ..................... [ 84%] 83s tests/test_python3.py .......................... [ 86%] 84s tests/test_raw_building.py ............. [ 87%] 86s tests/test_regrtest.py .............ss............ [ 88%] 88s tests/test_scoped_nodes.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 91%] 90s FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 95%] 91s FFFFFFFFFFFFFFFF.................................. [ 98%] 91s tests/test_stdlib.py .. [ 98%] 91s tests/test_transforms.py ......... [ 99%] 91s tests/test_type_params.py ..... [ 99%] 91s tests/test_utils.py ........ [100%] 91s 91s =================================== FAILURES =================================== 91s _______________________ TypingBrain.test_has_dunder_args _______________________ 91s 91s self = 91s 91s def test_has_dunder_args(self) -> None: 91s ast_node = builder.extract_node( 91s """ 91s from typing import Union 91s NumericTypes = Union[int, float] 91s NumericTypes.__args__ #@ 91s """ 91s ) 91s inferred = next(ast_node.infer()) 91s > assert isinstance(inferred, nodes.Tuple) 91s E AssertionError: assert False 91s E + where False = isinstance(Uninferable, ) 91s E + where = nodes.Tuple 91s 91s tests/brain/test_brain.py:747: AssertionError 91s ________________________ TypingBrain.test_typing_types _________________________ 91s 91s self = 91s 91s def test_typing_types(self) -> None: 91s ast_nodes = builder.extract_node( 91s """ 91s from typing import TypeVar, Iterable, Tuple, NewType, Dict, Union 91s TypeVar('MyTypeVar', int, float, complex) #@ 91s Iterable[Tuple[MyTypeVar, MyTypeVar]] #@ 91s TypeVar('AnyStr', str, bytes) #@ 91s NewType('UserId', str) #@ 91s Dict[str, str] #@ 91s Union[int, str] #@ 91s """ 91s ) 91s for node in ast_nodes: 91s inferred = next(node.infer()) 91s > self.assertIsInstance(inferred, nodes.ClassDef, node.as_string()) 91s E AssertionError: Uninferable is not an instance of : Union[int, str] 91s 91s tests/brain/test_brain.py:561: AssertionError 91s ____________________________ test_inference_parents ____________________________ 91s 91s def test_inference_parents() -> None: 91s """Test inference of ``pathlib.Path.parents``.""" 91s name_node = astroid.extract_node( 91s """ 91s from pathlib import Path 91s 91s current_path = Path().resolve() 91s path_parents = current_path.parents 91s path_parents 91s """ 91s ) 91s inferred = name_node.inferred() 91s assert len(inferred) == 1 91s assert isinstance(inferred[0], bases.Instance) 91s if PY313_PLUS: 91s > assert inferred[0].qname() == "builtins.tuple" 91s E AssertionError: assert 'pathlib._PathParents' == 'builtins.tuple' 91s E 91s E - builtins.tuple 91s E + pathlib._PathParents 91s 91s tests/brain/test_pathlib.py:27: AssertionError 91s ____________________ test_inference_parents_subscript_index ____________________ 91s 91s def test_inference_parents_subscript_index() -> None: 91s """Test inference of ``pathlib.Path.parents``, accessed by index.""" 91s path = astroid.extract_node( 91s """ 91s from pathlib import Path 91s 91s current_path = Path().resolve() 91s current_path.parents[2] #@ 91s """ 91s ) 91s 91s inferred = path.inferred() 91s assert len(inferred) == 1 91s assert isinstance(inferred[0], bases.Instance) 91s if PY313_PLUS: 91s > assert inferred[0].qname() == "pathlib._local.Path" 91s E AssertionError: assert 'builtins.tuple' == 'pathlib._local.Path' 91s E 91s E - pathlib._local.Path 91s E + builtins.tuple 91s 91s tests/brain/test_pathlib.py:47: AssertionError 91s _____________________ FileBuildTest.test_class_base_props ______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_builder.py:752: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ______________________ FileBuildTest.test_class_basenames ______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_builder.py:752: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ___________________ FileBuildTest.test_class_instance_attrs ____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_builder.py:752: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ FileBuildTest.test_class_locals ________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_builder.py:752: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ____________________ FileBuildTest.test_function_base_props ____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_builder.py:752: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ______________________ FileBuildTest.test_function_locals ______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_builder.py:752: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________________ FileBuildTest.test_method_base_props _____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_builder.py:752: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ FileBuildTest.test_method_locals _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_builder.py:752: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________________ FileBuildTest.test_module_base_props _____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_builder.py:752: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ FileBuildTest.test_module_locals _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_builder.py:752: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________________ FileBuildTest.test_unknown_encoding ______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_builder.py:752: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s __________________ InferenceTest.test_binary_op_or_union_type __________________ 91s 91s self = 91s 91s def test_binary_op_or_union_type(self) -> None: 91s """Binary or union is only defined for Python 3.10+.""" 91s code = """ 91s class A: ... 91s 91s int | 2 #@ 91s int | "Hello" #@ 91s int | ... #@ 91s int | A() #@ 91s int | None | 2 #@ 91s """ 91s ast_nodes = extract_node(code) 91s for n in ast_nodes: 91s assert n.inferred() == [util.Uninferable] 91s 91s code = """ 91s from typing import List 91s 91s class A: ... 91s class B: ... 91s 91s int | None #@ 91s int | str #@ 91s int | str | None #@ 91s A | B #@ 91s A | None #@ 91s List[int] | int #@ 91s tuple | int #@ 91s """ 91s ast_nodes = extract_node(code) 91s if not PY310_PLUS: 91s for n in ast_nodes: 91s assert n.inferred() == [util.Uninferable] 91s else: 91s i0 = ast_nodes[0].inferred()[0] 91s assert isinstance(i0, UnionType) 91s assert isinstance(i0.left, nodes.ClassDef) 91s assert i0.left.name == "int" 91s assert isinstance(i0.right, nodes.Const) 91s assert i0.right.value is None 91s 91s # Assert basic UnionType properties and methods 91s assert i0.callable() is False 91s assert i0.bool_value() is True 91s assert i0.pytype() == "types.UnionType" 91s assert i0.display_type() == "UnionType" 91s > assert str(i0) == "UnionType(UnionType)" 91s E AssertionError: assert 'UnionType(Union)' == 'UnionType(UnionType)' 91s E 91s E - UnionType(UnionType) 91s E ? ---- 91s E + UnionType(Union) 91s 91s tests/test_inference.py:1309: AssertionError 91s ________________________ LookupTest.test_builtin_lookup ________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ____________________________ LookupTest.test_class _____________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________________ LookupTest.test_class_ancestor_name ______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ______________________ LookupTest.test_class_in_function _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ LookupTest.test_class_variables ________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s __________________ LookupTest.test_decorator_arguments_lookup __________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ LookupTest.test_dict_comp_nested _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s __________________________ LookupTest.test_dict_comps __________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ______________________ LookupTest.test_explicit___name__ _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ________________ LookupTest.test_function_argument_with_default ________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ___________________ LookupTest.test_function_module_special ____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ LookupTest.test_function_nested ________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________________ LookupTest.test_generator_attributes _____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ________________________ LookupTest.test_global_delete _________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ________________________ LookupTest.test_inner_classes _________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ________________ LookupTest.test_inner_decorator_member_lookup _________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ________________________ LookupTest.test_lambda_nested _________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ____________________________ LookupTest.test_limit _____________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ LookupTest.test_list_comp_nested _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ LookupTest.test_list_comp_target _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s __________________________ LookupTest.test_list_comps __________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ________________________ LookupTest.test_loopvar_hiding ________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ____________________________ LookupTest.test_method ____________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ____________________________ LookupTest.test_module ____________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ LookupTest.test_set_comp_closure _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ LookupTest.test_set_comp_nested ________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s __________________________ LookupTest.test_set_comps ___________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________________ LookupTest.test_static_method_lookup _____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_lookup.py:22: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ______________________ AsStringTest.test_module_as_string ______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def test_module_as_string(self) -> None: 91s """Check as_string on a whole module prepared to be returned identically.""" 91s > module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_nodes.py:114: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________________ ImportNodeTest.test_absolute_import ______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_nodes.py:481: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ________________________ ImportNodeTest.test_as_string _________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_nodes.py:481: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ___________________ ImportNodeTest.test_bad_import_inference ___________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_nodes.py:481: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ ImportNodeTest.test_conditional ________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_nodes.py:481: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ____________________ ImportNodeTest.test_conditional_import ____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_nodes.py:481: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ____________________ ImportNodeTest.test_from_self_resolve _____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_nodes.py:481: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ___________________ ImportNodeTest.test_import_self_resolve ____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_nodes.py:481: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ___________________ ImportNodeTest.test_more_absolute_import ___________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_nodes.py:481: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ________________________ ImportNodeTest.test_real_name _________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_nodes.py:481: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _________________ ModuleNodeTest.test_comment_before_docstring _________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ______________________ ModuleNodeTest.test_dict_interface ______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________________ ModuleNodeTest.test_file_stream_api ______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s __________________ ModuleNodeTest.test_file_stream_in_memory ___________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ___________________ ModuleNodeTest.test_file_stream_physical ___________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _________________________ ModuleNodeTest.test_getattr __________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _________________________ ModuleNodeTest.test_import_1 _________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _________________________ ModuleNodeTest.test_import_2 _________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ________________ ModuleNodeTest.test_import_unavailable_module _________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ______________________ ModuleNodeTest.test_module_getattr ______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ___________________ ModuleNodeTest.test_multiline_docstring ____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ ModuleNodeTest.test_public_names _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ________________ ModuleNodeTest.test_relative_to_absolute_name _________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ________ ModuleNodeTest.test_relative_to_absolute_name_beyond_top_level ________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ___________________ ModuleNodeTest.test_singleline_docstring ___________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ____________________ ModuleNodeTest.test_special_attributes ____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ________________________ ModuleNodeTest.test_stream_api ________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s __________________ ModuleNodeTest.test_wildcard_import_names ___________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ____________________ ModuleNodeTest.test_without_docstring _____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ________ FunctionNodeTest.test_abstract_methods_are_not_implicitly_none ________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ________________________ FunctionNodeTest.test_argnames ________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ____________________ FunctionNodeTest.test_argnames_lambda _____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________ FunctionNodeTest.test_decorator_builtin_descriptors ______________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________________ FunctionNodeTest.test_default_value ______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________________ FunctionNodeTest.test_dict_interface _____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ______________________ FunctionNodeTest.test_display_type ______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ________________ FunctionNodeTest.test_docstring_special_cases _________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ___________ FunctionNodeTest.test_dunder_class_local_to_classmethod ____________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________ FunctionNodeTest.test_dunder_class_local_to_function _____________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ______________ FunctionNodeTest.test_dunder_class_local_to_method ______________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ______________________ FunctionNodeTest.test_format_args _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________ FunctionNodeTest.test_format_args_keyword_only_args ______________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ FunctionNodeTest.test_four_args ________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ___________________ FunctionNodeTest.test_func_instance_attr ___________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________________ FunctionNodeTest.test_func_is_bound ______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ________________________ FunctionNodeTest.test_igetattr ________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ____________________ FunctionNodeTest.test_inference_error _____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ______________________ FunctionNodeTest.test_is_abstract _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _________________ FunctionNodeTest.test_is_abstract_decorated __________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ______________________ FunctionNodeTest.test_is_generator ______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ FunctionNodeTest.test_is_method ________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________________ FunctionNodeTest.test_lambda_getattr _____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________________ FunctionNodeTest.test_lambda_pytype ______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ______________________ FunctionNodeTest.test_lambda_qname ______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s __________________ FunctionNodeTest.test_method_init_subclass __________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s __________________ FunctionNodeTest.test_multiline_docstring ___________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________ FunctionNodeTest.test_multiline_docstring_async ________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ FunctionNodeTest.test_navigation _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________ FunctionNodeTest.test_no_returns_is_implicitly_none ______________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ___________ FunctionNodeTest.test_only_raises_is_not_implicitly_none ___________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ________________ FunctionNodeTest.test_positional_only_argnames ________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ___________ FunctionNodeTest.test_return_annotation_is_not_the_last ____________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________________ FunctionNodeTest.test_return_nothing _____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s __________________ FunctionNodeTest.test_singleline_docstring __________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ___________________ FunctionNodeTest.test_special_attributes ___________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ___________ FunctionNodeTest.test_type_builtin_descriptor_subclasses ___________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ___________________ FunctionNodeTest.test_without_docstring ____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________________ ClassNodeTest.test__bases__attribute _____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ______________________ ClassNodeTest.test__mro__attribute ______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ ClassNodeTest.test_add_metaclass _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _________________ ClassNodeTest.test_all_ancestors_need_slots __________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _________________________ ClassNodeTest.test_ancestors _________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s __________________ ClassNodeTest.test_class_extra_decorators ___________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _________ ClassNodeTest.test_class_extra_decorators_frame_is_not_class _________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _ ClassNodeTest.test_class_extra_decorators_only_assignment_names_are_considered _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ____ ClassNodeTest.test_class_extra_decorators_only_callfunc_are_considered ____ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____ ClassNodeTest.test_class_extra_decorators_only_same_name_considered ______ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ ClassNodeTest.test_class_getattr _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ______________________ ClassNodeTest.test_class_keywords _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s __________________ ClassNodeTest.test_classmethod_attributes ___________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _________________ ClassNodeTest.test_cls_special_attributes_1 __________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _________________ ClassNodeTest.test_cls_special_attributes_2 __________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ______________________ ClassNodeTest.test_dict_interface _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ________________ ClassNodeTest.test_duplicate_bases_namedtuple _________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______ ClassNodeTest.test_extra_decorators_only_class_level_assignments _______ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ______________ ClassNodeTest.test_function_with_decorator_lineno _______________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s __________ ClassNodeTest.test_generator_from_infer_call_result_parent __________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ___________________ ClassNodeTest.test_getattr_from_grandpa ____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _________________ ClassNodeTest.test_getattr_method_transform __________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________ ClassNodeTest.test_getattr_with_enpty_annassign ________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ____________________ ClassNodeTest.test_has_dynamic_getattr ____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ____________________ ClassNodeTest.test_implicit_metaclass _____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _________________ ClassNodeTest.test_implicit_metaclass_lookup _________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ ClassNodeTest.test_inner_classes _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s __________________ ClassNodeTest.test_instance_attr_ancestors __________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________ ClassNodeTest.test_instance_bound_method_lambdas _______________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ______________ ClassNodeTest.test_instance_bound_method_lambdas_2 ______________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________________ ClassNodeTest.test_instance_getattr ______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________ ClassNodeTest.test_instance_getattr_with_class_attr ______________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ________________ ClassNodeTest.test_instance_special_attributes ________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ________________________ ClassNodeTest.test_kite_graph _________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ___________________ ClassNodeTest.test_local_attr_ancestors ____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s __________________ ClassNodeTest.test_local_attr_invalid_mro ___________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ______________________ ClassNodeTest.test_local_attr_mro _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ______________________ ClassNodeTest.test_metaclass_error ______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _________________ ClassNodeTest.test_metaclass_generator_hack __________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ____________ ClassNodeTest.test_metaclass_generator_hack_enum_base _____________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________________ ClassNodeTest.test_metaclass_lookup ______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________ ClassNodeTest.test_metaclass_lookup_inference_errors _____________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________ ClassNodeTest.test_metaclass_lookup_using_same_class _____________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ______________________ ClassNodeTest.test_metaclass_type _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ____________________ ClassNodeTest.test_metaclass_yes_leak _____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s __________________________ ClassNodeTest.test_methods __________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ____________________________ ClassNodeTest.test_mro ____________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ ClassNodeTest.test_mro_generic_1 _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ ClassNodeTest.test_mro_generic_2 _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ ClassNodeTest.test_mro_generic_3 _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ ClassNodeTest.test_mro_generic_4 _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ ClassNodeTest.test_mro_generic_5 _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ ClassNodeTest.test_mro_generic_6 _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _______________________ ClassNodeTest.test_mro_generic_7 _______________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ____________________ ClassNodeTest.test_mro_generic_error_1 ____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ____________________ ClassNodeTest.test_mro_generic_error_2 ____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ___________________ ClassNodeTest.test_mro_typing_extensions ___________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ________________ ClassNodeTest.test_mro_with_attribute_classes _________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ____________________ ClassNodeTest.test_mro_with_factories _____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ____________________ ClassNodeTest.test_multiline_docstring ____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ________________________ ClassNodeTest.test_navigation _________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ________________ ClassNodeTest.test_no_infinite_metaclass_loop _________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _________ ClassNodeTest.test_no_infinite_metaclass_loop_with_redefine __________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _________________ ClassNodeTest.test_nonregr_infer_callresult __________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ___________________ ClassNodeTest.test_singleline_docstring ____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ___________________________ ClassNodeTest.test_slots ___________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s __________ ClassNodeTest.test_slots_added_dynamically_still_inferred ___________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _________________ ClassNodeTest.test_slots_empty_list_of_slots _________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ____________________ ClassNodeTest.test_slots_for_dict_keys ____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _________________ ClassNodeTest.test_slots_taken_from_parents __________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ___________________________ ClassNodeTest.test_type ____________________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ___________________ ClassNodeTest.test_type_three_arguments ____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ___________ ClassNodeTest.test_using_invalid_six_add_metaclass_call ____________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s __________________ ClassNodeTest.test_with_invalid_metaclass ___________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s ____________________ ClassNodeTest.test_with_metaclass_mro _____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s _____________________ ClassNodeTest.test_without_docstring _____________________ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s > node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:181: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 91s parsed = parser_module.parse( 91s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 91s return ast.parse(string, filename=filename, type_comments=type_comments) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 91s filename = 'data.module', mode = 'exec' 91s 91s def parse(source, filename='', mode='exec', *, 91s type_comments=False, feature_version=None, optimize=-1): 91s """ 91s Parse the source into an AST node. 91s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 91s Pass type_comments=True to get back type comments where the syntax allows. 91s """ 91s flags = PyCF_ONLY_AST 91s if optimize > 0: 91s flags |= PyCF_OPTIMIZED_AST 91s if type_comments: 91s flags |= PyCF_TYPE_COMMENTS 91s if feature_version is None: 91s feature_version = -1 91s elif isinstance(feature_version, tuple): 91s major, minor = feature_version # Should be a 2-tuple. 91s if major != 3: 91s raise ValueError(f"Unsupported major version: {major}") 91s feature_version = minor 91s # Else it should be an int giving the minor version for 3.x. 91s > return compile(source, filename, mode, flags, 91s _feature_version=feature_version, optimize=optimize) 91s E File "data.module", line 62 91s E SyntaxError: 'return' in a 'finally' block 91s 91s /usr/lib/python3.14/ast.py:46: SyntaxError 91s 91s The above exception was the direct cause of the following exception: 91s 91s self = 91s 91s def setUp(self) -> None: 91s super().setUp() 91s > self.module = resources.build_file("data/module.py", "data.module") 91s 91s tests/test_scoped_nodes.py:73: 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s tests/resources.py:23: in build_file 91s return builder.AstroidBuilder().file_build(find(path), modname) 91s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 91s module, builder = self._data_build(data, modname, path) 91s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91s 91s self = 91s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 91s modname = 'data.module' 91s path = '/tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 91s 91s def _data_build( 91s self, data: str, modname: str, path: str | None 91s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 91s """Build tree node from data and add some informations.""" 91s try: 91s node, parser_module = _parse_string( 91s data, type_comments=True, modname=modname 91s ) 91s except (TypeError, ValueError, SyntaxError) as exc: 91s > raise AstroidSyntaxError( 91s "Parsing Python code failed:\n{error}", 91s source=data, 91s modname=modname, 91s path=path, 91s error=exc, 91s ) from exc 91s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 91s E 'return' in a 'finally' block (data.module, line 62) 91s 91s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 91s =========================== short test summary info ============================ 91s FAILED tests/brain/test_brain.py::TypingBrain::test_has_dunder_args - Asserti... 91s FAILED tests/brain/test_brain.py::TypingBrain::test_typing_types - AssertionE... 91s FAILED tests/brain/test_pathlib.py::test_inference_parents - AssertionError: ... 91s FAILED tests/brain/test_pathlib.py::test_inference_parents_subscript_index - ... 91s FAILED tests/test_builder.py::FileBuildTest::test_class_base_props - astroid.... 91s FAILED tests/test_builder.py::FileBuildTest::test_class_basenames - astroid.e... 91s FAILED tests/test_builder.py::FileBuildTest::test_class_instance_attrs - astr... 91s FAILED tests/test_builder.py::FileBuildTest::test_class_locals - astroid.exce... 91s FAILED tests/test_builder.py::FileBuildTest::test_function_base_props - astro... 91s FAILED tests/test_builder.py::FileBuildTest::test_function_locals - astroid.e... 91s FAILED tests/test_builder.py::FileBuildTest::test_method_base_props - astroid... 91s FAILED tests/test_builder.py::FileBuildTest::test_method_locals - astroid.exc... 91s FAILED tests/test_builder.py::FileBuildTest::test_module_base_props - astroid... 91s FAILED tests/test_builder.py::FileBuildTest::test_module_locals - astroid.exc... 91s FAILED tests/test_builder.py::FileBuildTest::test_unknown_encoding - astroid.... 91s FAILED tests/test_inference.py::InferenceTest::test_binary_op_or_union_type 91s FAILED tests/test_lookup.py::LookupTest::test_builtin_lookup - astroid.except... 91s FAILED tests/test_lookup.py::LookupTest::test_class - astroid.exceptions.Astr... 91s FAILED tests/test_lookup.py::LookupTest::test_class_ancestor_name - astroid.e... 91s FAILED tests/test_lookup.py::LookupTest::test_class_in_function - astroid.exc... 91s FAILED tests/test_lookup.py::LookupTest::test_class_variables - astroid.excep... 91s FAILED tests/test_lookup.py::LookupTest::test_decorator_arguments_lookup - as... 91s FAILED tests/test_lookup.py::LookupTest::test_dict_comp_nested - astroid.exce... 91s FAILED tests/test_lookup.py::LookupTest::test_dict_comps - astroid.exceptions... 91s FAILED tests/test_lookup.py::LookupTest::test_explicit___name__ - astroid.exc... 91s FAILED tests/test_lookup.py::LookupTest::test_function_argument_with_default 91s FAILED tests/test_lookup.py::LookupTest::test_function_module_special - astro... 91s FAILED tests/test_lookup.py::LookupTest::test_function_nested - astroid.excep... 91s FAILED tests/test_lookup.py::LookupTest::test_generator_attributes - astroid.... 91s FAILED tests/test_lookup.py::LookupTest::test_global_delete - astroid.excepti... 91s FAILED tests/test_lookup.py::LookupTest::test_inner_classes - astroid.excepti... 91s FAILED tests/test_lookup.py::LookupTest::test_inner_decorator_member_lookup 91s FAILED tests/test_lookup.py::LookupTest::test_lambda_nested - astroid.excepti... 91s FAILED tests/test_lookup.py::LookupTest::test_limit - astroid.exceptions.Astr... 91s FAILED tests/test_lookup.py::LookupTest::test_list_comp_nested - astroid.exce... 91s FAILED tests/test_lookup.py::LookupTest::test_list_comp_target - astroid.exce... 91s FAILED tests/test_lookup.py::LookupTest::test_list_comps - astroid.exceptions... 91s FAILED tests/test_lookup.py::LookupTest::test_loopvar_hiding - astroid.except... 91s FAILED tests/test_lookup.py::LookupTest::test_method - astroid.exceptions.Ast... 91s FAILED tests/test_lookup.py::LookupTest::test_module - astroid.exceptions.Ast... 91s FAILED tests/test_lookup.py::LookupTest::test_set_comp_closure - astroid.exce... 91s FAILED tests/test_lookup.py::LookupTest::test_set_comp_nested - astroid.excep... 91s FAILED tests/test_lookup.py::LookupTest::test_set_comps - astroid.exceptions.... 91s FAILED tests/test_lookup.py::LookupTest::test_static_method_lookup - astroid.... 91s FAILED tests/test_nodes.py::AsStringTest::test_module_as_string - astroid.exc... 91s FAILED tests/test_nodes.py::ImportNodeTest::test_absolute_import - astroid.ex... 91s FAILED tests/test_nodes.py::ImportNodeTest::test_as_string - astroid.exceptio... 91s FAILED tests/test_nodes.py::ImportNodeTest::test_bad_import_inference - astro... 91s FAILED tests/test_nodes.py::ImportNodeTest::test_conditional - astroid.except... 91s FAILED tests/test_nodes.py::ImportNodeTest::test_conditional_import - astroid... 91s FAILED tests/test_nodes.py::ImportNodeTest::test_from_self_resolve - astroid.... 91s FAILED tests/test_nodes.py::ImportNodeTest::test_import_self_resolve - astroi... 91s FAILED tests/test_nodes.py::ImportNodeTest::test_more_absolute_import - astro... 91s FAILED tests/test_nodes.py::ImportNodeTest::test_real_name - astroid.exceptio... 91s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_comment_before_docstring 91s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_dict_interface - astr... 91s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_file_stream_api - ast... 91s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_file_stream_in_memory 91s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_file_stream_physical 91s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_getattr - astroid.exc... 91s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_import_1 - astroid.ex... 91s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_import_2 - astroid.ex... 91s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_import_unavailable_module 91s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_module_getattr - astr... 91s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_multiline_docstring 91s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_public_names - astroi... 91s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_relative_to_absolute_name 91s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_relative_to_absolute_name_beyond_top_level 91s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_singleline_docstring 91s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_special_attributes - ... 91s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_stream_api - astroid.... 91s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_wildcard_import_names 91s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_without_docstring - a... 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_abstract_methods_are_not_implicitly_none 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_argnames - astroid.... 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_argnames_lambda - a... 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_decorator_builtin_descriptors 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_default_value - ast... 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_dict_interface - as... 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_display_type - astr... 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_docstring_special_cases 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_dunder_class_local_to_classmethod 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_dunder_class_local_to_function 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_dunder_class_local_to_method 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_format_args - astro... 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_format_args_keyword_only_args 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_four_args - astroid... 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_func_instance_attr 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_func_is_bound - ast... 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_igetattr - astroid.... 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_inference_error - a... 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_is_abstract - astro... 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_is_abstract_decorated 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_is_generator - astr... 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_is_method - astroid... 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_lambda_getattr - as... 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_lambda_pytype - ast... 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_lambda_qname - astr... 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_method_init_subclass 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_multiline_docstring 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_multiline_docstring_async 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_navigation - astroi... 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_no_returns_is_implicitly_none 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_only_raises_is_not_implicitly_none 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_positional_only_argnames 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_return_annotation_is_not_the_last 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_return_nothing - as... 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_singleline_docstring 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_special_attributes 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_type_builtin_descriptor_subclasses 91s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_without_docstring 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test__bases__attribute - as... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test__mro__attribute - astr... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_add_metaclass - astroi... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_all_ancestors_need_slots 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_ancestors - astroid.ex... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_extra_decorators 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_extra_decorators_frame_is_not_class 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_extra_decorators_only_assignment_names_are_considered 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_extra_decorators_only_callfunc_are_considered 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_extra_decorators_only_same_name_considered 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_getattr - astroi... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_keywords - astro... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_classmethod_attributes 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_cls_special_attributes_1 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_cls_special_attributes_2 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_dict_interface - astro... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_duplicate_bases_namedtuple 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_extra_decorators_only_class_level_assignments 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_function_with_decorator_lineno 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_generator_from_infer_call_result_parent 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_getattr_from_grandpa 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_getattr_method_transform 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_getattr_with_enpty_annassign 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_has_dynamic_getattr - ... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_implicit_metaclass - a... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_implicit_metaclass_lookup 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_inner_classes - astroi... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_instance_attr_ancestors 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_instance_bound_method_lambdas 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_instance_bound_method_lambdas_2 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_instance_getattr - ast... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_instance_getattr_with_class_attr 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_instance_special_attributes 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_kite_graph - astroid.e... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_local_attr_ancestors 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_local_attr_invalid_mro 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_local_attr_mro - astro... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_error - astr... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_generator_hack 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_generator_hack_enum_base 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_lookup - ast... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_lookup_inference_errors 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_lookup_using_same_class 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_type - astro... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_yes_leak - a... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_methods - astroid.exce... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro - astroid.exceptio... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_1 - astroi... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_2 - astroi... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_3 - astroi... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_4 - astroi... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_5 - astroi... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_6 - astroi... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_7 - astroi... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_error_1 - ... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_error_2 - ... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_typing_extensions 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_with_attribute_classes 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_with_factories - a... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_multiline_docstring - ... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_navigation - astroid.e... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_no_infinite_metaclass_loop 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_no_infinite_metaclass_loop_with_redefine 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_nonregr_infer_callresult 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_singleline_docstring 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_slots - astroid.except... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_slots_added_dynamically_still_inferred 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_slots_empty_list_of_slots 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_slots_for_dict_keys - ... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_slots_taken_from_parents 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_type - astroid.excepti... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_type_three_arguments 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_using_invalid_six_add_metaclass_call 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_with_invalid_metaclass 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_with_metaclass_mro - a... 91s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_without_docstring - as... 91s ========== 187 failed, 1452 passed, 54 skipped, 15 xfailed in 22.28s =========== 92s E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd /tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build; python3.14 -m pytest tests 92s I: pybuild base:311: cd /tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build; python3.13 -m pytest tests 93s ============================= test session starts ============================== 93s platform linux -- Python 3.13.9, pytest-8.3.5, pluggy-1.6.0 93s rootdir: /tmp/autopkgtest.LkXRjH/autopkgtest_tmp/build 93s configfile: pyproject.toml 93s plugins: typeguard-4.4.2 93s collected 1708 items 93s 93s tests/brain/numpy/test_core_einsumfunc.py ss [ 0%] 93s tests/brain/numpy/test_core_fromnumeric.py s [ 0%] 93s tests/brain/numpy/test_core_function_base.py s [ 0%] 93s tests/brain/numpy/test_core_multiarray.py sssss [ 0%] 93s tests/brain/numpy/test_core_numeric.py sssss [ 0%] 93s tests/brain/numpy/test_core_numerictypes.py sssssss.. [ 1%] 93s tests/brain/numpy/test_core_umath.py ssssssss [ 1%] 93s tests/brain/numpy/test_ma.py ssss [ 2%] 93s tests/brain/numpy/test_ndarray.py sss [ 2%] 93s tests/brain/numpy/test_random_mtrand.py ss [ 2%] 93s tests/brain/test_argparse.py . [ 2%] 94s tests/brain/test_attr.py ....... [ 2%] 94s tests/brain/test_brain.py ......s.....ss................................ [ 5%] 94s ............s.........................................................x. [ 9%] 95s ..............s...... [ 10%] 95s tests/brain/test_builtin.py .................. [ 12%] 95s tests/brain/test_ctypes.py ....x........................ [ 13%] 95s tests/brain/test_dataclasses.py ........................................ [ 16%] 95s ......................................x... [ 18%] 95s tests/brain/test_dateutil.py . [ 18%] 95s tests/brain/test_enum.py ............................. [ 20%] 95s tests/brain/test_hashlib.py ... [ 20%] 95s tests/brain/test_multiprocessing.py ... [ 20%] 95s tests/brain/test_named_tuple.py ....................... [ 21%] 95s tests/brain/test_nose.py s [ 22%] 95s tests/brain/test_pathlib.py .... [ 22%] 95s tests/brain/test_pytest.py . [ 22%] 95s tests/brain/test_qt.py sss [ 22%] 95s tests/brain/test_regex.py ss [ 22%] 95s tests/brain/test_signal.py ... [ 22%] 96s tests/brain/test_six.py ....... [ 23%] 96s tests/brain/test_ssl.py .. [ 23%] 96s tests/brain/test_threading.py .... [ 23%] 96s tests/brain/test_typing.py ..... [ 23%] 97s tests/brain/test_typing_extensions.py . [ 23%] 97s tests/brain/test_unittest.py . [ 23%] 98s tests/test_builder.py .................................................. [ 26%] 98s ........ [ 27%] 98s tests/test_constraint.py ................................... [ 29%] 98s tests/test_decorators.py ... [ 29%] 98s tests/test_filter_statements.py . [ 29%] 98s tests/test_group_exceptions.py ... [ 29%] 98s tests/test_helpers.py ............... [ 30%] 98s tests/test_inference.py ................................................ [ 33%] 98s ............................................x...........x......x........ [ 37%] 98s ..................................................x..................... [ 41%] 98s ........................................................................ [ 46%] 99s ................................................x........xx............. [ 50%] 99s ........x...x................................................x.......... [ 54%] 99s ................................. [ 56%] 99s tests/test_inference_calls.py ........................ [ 57%] 99s tests/test_lookup.py ................................................... [ 60%] 99s .... [ 61%] 110s tests/test_manager.py .....................................s....... [ 63%] 110s tests/test_modutils.py ................................................. [ 66%] 110s ................s. [ 67%] 111s tests/test_nodes.py .................................................... [ 70%] 111s ........................................................................ [ 74%] 111s ................................................................ [ 78%] 111s tests/test_nodes_lineno.py ....................... [ 80%] 111s tests/test_nodes_position.py ... [ 80%] 111s tests/test_object_model.py x...............x.........s........... [ 82%] 112s tests/test_objects.py ...................... [ 83%] 112s tests/test_protocols.py ..................... [ 84%] 112s tests/test_python3.py .......................... [ 86%] 112s tests/test_raw_building.py ............. [ 87%] 115s tests/test_regrtest.py .............ss............ [ 88%] 116s tests/test_scoped_nodes.py ............................................. [ 91%] 117s ........................................................................ [ 95%] 117s .................................................. [ 98%] 117s tests/test_stdlib.py .. [ 98%] 117s tests/test_transforms.py ......... [ 99%] 117s tests/test_type_params.py ..... [ 99%] 117s tests/test_utils.py ........ [100%] 117s 117s ================ 1639 passed, 54 skipped, 15 xfailed in 25.26s ================= 118s pybuild-autopkgtest: error: pybuild --autopkgtest --test-pytest -i python{version} -p "3.14 3.13" returned exit code 13 118s make: *** [/tmp/VxWnIZBZKf/run:4: pybuild-autopkgtest] Error 25 118s pybuild-autopkgtest: error: /tmp/VxWnIZBZKf/run pybuild-autopkgtest returned exit code 2 119s autopkgtest [11:51:44]: test pybuild-autopkgtest: -----------------------] 119s autopkgtest [11:51:44]: test pybuild-autopkgtest: - - - - - - - - - - results - - - - - - - - - - 119s pybuild-autopkgtest FAIL non-zero exit status 25 120s autopkgtest [11:51:45]: @@@@@@@@@@@@@@@@@@@@ summary 120s pybuild-autopkgtest FAIL non-zero exit status 25