gh-118082: Improve import without names syntax error message (#118083)

This commit is contained in:
Nikita Sobolev 2024-04-23 15:00:52 +03:00 committed by GitHub
parent eb927e9fc8
commit de1f686827
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 219 additions and 149 deletions

View file

@ -1699,6 +1699,18 @@ SyntaxError: Did you mean to use 'from ... import ...' instead?
Traceback (most recent call last):
SyntaxError: invalid syntax
>>> from i import
Traceback (most recent call last):
SyntaxError: Expected one or more names after 'import'
>>> from .. import
Traceback (most recent call last):
SyntaxError: Expected one or more names after 'import'
>>> import
Traceback (most recent call last):
SyntaxError: Expected one or more names after 'import'
>>> (): int
Traceback (most recent call last):
SyntaxError: only single target (not tuple) can be annotated