gh-110938: Fix error messages for indented blocks with functions and classes with generic type parameters (#110973)

This commit is contained in:
Pablo Galindo Salgado 2023-10-17 13:45:13 +01:00 committed by GitHub
parent be5e8a0103
commit 24e4ec7766
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 22 deletions

View file

@ -1446,11 +1446,21 @@ Specialized indentation errors:
Traceback (most recent call last):
IndentationError: expected an indented block after function definition on line 1
>>> def foo[T](x, /, y, *, z=2):
... pass
Traceback (most recent call last):
IndentationError: expected an indented block after function definition on line 1
>>> class Blech(A):
... pass
Traceback (most recent call last):
IndentationError: expected an indented block after class definition on line 1
>>> class Blech[T](A):
... pass
Traceback (most recent call last):
IndentationError: expected an indented block after class definition on line 1
>>> match something:
... pass
Traceback (most recent call last):