diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2024-04-23 12:00:52 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-23 12:00:52 (GMT) |
commit | de1f6868270d31f56c388ef416daacd35feb152d (patch) | |
tree | 65b30c6d5b2cd0d8acf75fc9150decac082c0852 /Lib/test/test_syntax.py | |
parent | eb927e9fc823de9539fcb82c9ea9d055462eb04a (diff) | |
download | cpython-de1f6868270d31f56c388ef416daacd35feb152d.zip cpython-de1f6868270d31f56c388ef416daacd35feb152d.tar.gz cpython-de1f6868270d31f56c388ef416daacd35feb152d.tar.bz2 |
gh-118082: Improve `import` without names syntax error message (#118083)
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r-- | Lib/test/test_syntax.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index dfa2a3b..e9bec33 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -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 |