gh-93691: fix too broad source locations of for statement iterators#120330
gh-93691: fix too broad source locations of for statement iterators#120330iritkatriel merged 5 commits into
Conversation
|
Thanks @iritkatriel for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
Sorry, something went wrong.
…tors (pythonGH-120330) (cherry picked from commit 97b69db) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
|
Sorry, @iritkatriel, I could not cleanly backport this to |
Sorry, something went wrong.
…t iterators (pythonGH-120330). (cherry picked from commit 97b69db) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot AMD64 Fedora Stable LTO + PGO 3.13 has failed when building commit 39825a7. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/1426/builds/109 Summary of the results of the build (if available): Click to see traceback logsremote: Enumerating objects: 16, done.
remote: Counting objects: 7% (1/13)
remote: Counting objects: 15% (2/13)
remote: Counting objects: 23% (3/13)
remote: Counting objects: 30% (4/13)
remote: Counting objects: 38% (5/13)
remote: Counting objects: 46% (6/13)
remote: Counting objects: 53% (7/13)
remote: Counting objects: 61% (8/13)
remote: Counting objects: 69% (9/13)
remote: Counting objects: 76% (10/13)
remote: Counting objects: 84% (11/13)
remote: Counting objects: 92% (12/13)
remote: Counting objects: 100% (13/13)
remote: Counting objects: 100% (13/13), done.
remote: Compressing objects: 8% (1/12)
remote: Compressing objects: 16% (2/12)
remote: Compressing objects: 25% (3/12)
remote: Compressing objects: 33% (4/12)
remote: Compressing objects: 41% (5/12)
remote: Compressing objects: 50% (6/12)
remote: Compressing objects: 58% (7/12)
remote: Compressing objects: 66% (8/12)
remote: Compressing objects: 75% (9/12)
remote: Compressing objects: 83% (10/12)
remote: Compressing objects: 91% (11/12)
remote: Compressing objects: 100% (12/12)
remote: Compressing objects: 100% (12/12), done.
remote: Total 16 (delta 1), reused 6 (delta 1), pack-reused 3
From https://github.com/python/cpython
* branch 3.13 -> FETCH_HEAD
Note: switching to '39825a7533ccf1aa0343d14fe88015db4ee6ef93'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at 39825a7533 [3.13] gh-93691: fix too broad source locations of for statement iterators (GH-120330) (#120399)
Switched to and reset branch '3.13'
configure: WARNING: no system libmpdecimal found; falling back to bundled libmpdecimal (deprecated and scheduled for removal in Python 3.15)
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
make[2]: [Makefile:3121: clean-retain-profile] Error 1 (ignored)
ar: unable to copy file 'libpython3.13.a'; reason: Success
make[2]: *** [Makefile:1047: libpython3.13.a] Error 1
make[1]: *** [Makefile:877: profile-gen-stamp] Error 2
make: *** [Makefile:889: profile-run-stamp] Error 2 |
Sorry, something went wrong.
|
hi @iritkatriel, I integraded the bytecode changes into executing and was confused why the source-ranges changed for for-loops but not for comprehensions? class Foo:
def __iter__(self):
assert False
a = [x for x in Foo()]output (Python 3.12.5): Traceback (most recent call last):
File "/home/frank/projects/executing/codi.py", line 5, in <module>
a = [x for x in Foo()]
^^^^^^^^^^^^^^^^^^
File "/home/frank/projects/executing/codi.py", line 3, in __iter__
assert False
^^^^^
AssertionErrorIs there a reason for this or have they simply been forgotten? |
Sorry, something went wrong.
|
That a different story. Let's reopen the issue or create a new one for compressions. |
Sorry, something went wrong.
Before this PR the error location covers the entire for-block (with body).