Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
Closed
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
When a uop encounters an error, the line number is set to -1 or to the wrong place.
Repro (on latest main):
a = 1 def func(): global a i = 20 while i > 0: del a i -= 1 if i >= 3: a = 2 func() Run this normally and you get this traceback:
Traceback (most recent call last): File "/Users/guido/cpython/t.py", line 12, in <module> func() File "/Users/guido/cpython/t.py", line 7, in func del a ^ NameError: name 'a' is not defined But run with -Xuops, and you get:
Traceback (most recent call last): File "/Users/guido/cpython/t.py", line 12, in <module> func() File "/Users/guido/cpython/t.py", line -1, in func NameError: name 'a' is not defined Linked PRs
Metadata
Metadata
Assignees
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error