gh-119180: PEP 649 compiler changes (#119361)

This commit is contained in:
Jelle Zijlstra 2024-06-11 07:06:49 -06:00 committed by GitHub
parent 02c1dfff07
commit 9b8611eeea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 610 additions and 329 deletions

View file

@ -622,6 +622,7 @@ class TracebackErrorLocationCaretTestBase:
def f_with_type():
def foo(a: THIS_DOES_NOT_EXIST ) -> int:
return 0
foo.__annotations__
lineno_f = f_with_type.__code__.co_firstlineno
expected_f = (
@ -629,7 +630,9 @@ class TracebackErrorLocationCaretTestBase:
f' File "{__file__}", line {self.callable_line}, in get_exception\n'
' callable()\n'
' ~~~~~~~~^^\n'
f' File "{__file__}", line {lineno_f+1}, in f_with_type\n'
f' File "{__file__}", line {lineno_f+3}, in f_with_type\n'
' foo.__annotations__\n'
f' File "{__file__}", line {lineno_f+1}, in __annotate__\n'
' def foo(a: THIS_DOES_NOT_EXIST ) -> int:\n'
' ^^^^^^^^^^^^^^^^^^^\n'
)