mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
gh-118082: Improve import
without names syntax error message (#118083)
This commit is contained in:
parent
eb927e9fc8
commit
de1f686827
4 changed files with 219 additions and 149 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue