bpo-46042: Improve SyntaxError locations in the symbol table#30059
Conversation
|
Looks good to me! I like the macros and just having |
Sorry, something went wrong.
|
I think we could be even more general. It seems the other two remaining uses of [x for x in range(10)
if (yield) == 5]def f():
from math import * |
Sorry, something went wrong.
|
The second one is a bit more complex because we would need to identify which of the comprehension generators have a 'yield' inside, but that happens downstream from us in the visitors. |
Sorry, something went wrong.
|
From the second example I have submitted another commit |
Sorry, something went wrong.
|
PyPy has the equivalent of an extra |
Sorry, something went wrong.
We would need to also know the comprehension type to raise properly, which is a bit messy. Do you have one extra enum or 4 extra ones? Edit: I did a prototype but is quite long so I will do this in another PR |
Sorry, something went wrong.
|
Nevermind, I found a better workaround that is not too inelegant IMHO |
Sorry, something went wrong.
|
Nice, that's a good approach! |
Sorry, something went wrong.
|
Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
Sorry, something went wrong.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot ARM64 macOS 3.x has failed when building commit 59435ee. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/725/builds/575 Summary of the results of the build (if available): == Tests result: ENV CHANGED == 410 tests OK. 10 slowest tests:
1 test altered the execution environment: 17 tests skipped: Total duration: 9 min 28 sec Click to see traceback logsTraceback (most recent call last):
File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/threading.py", line 1031, in _bootstrap_inner
self.run()
^^^^^^^^^^
File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_ftplib.py", line 298, in run
asyncore.loop(timeout=0.1, count=1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/asyncore.py", line 214, in loop
poll_fun(timeout, map)
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/asyncore.py", line 157, in poll
read(obj)
^^^^^^^^^
File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/asyncore.py", line 94, in read
obj.handle_error()
^^^^^^^^^^^^^^^^^^
File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_ftplib.py", line 421, in handle_error
raise Exception
^^^^^^^^^^^^^^^
Exception
k
Traceback (most recent call last):
File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/asyncore.py", line 90, in read
obj.handle_read_event()
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_ftplib.py", line 384, in handle_read_event
self._do_ssl_handshake()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_ftplib.py", line 345, in _do_ssl_handshake
self.socket.do_handshake()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/ssl.py", line 1346, in do_handshake
self._sslobj.do_handshake()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (_ssl.c:998)
Traceback (most recent call last):
File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/multiprocessing/resource_tracker.py", line 209, in main
cache[rtype].remove(name)
^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: '/psm_46c6e6df'
Traceback (most recent call last):
File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/multiprocessing/resource_tracker.py", line 209, in main
cache[rtype].remove(name)
^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: '/psm_8c999b84'
|
Sorry, something went wrong.
https://bugs.python.org/issue46042