diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-06-22 16:28:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-22 16:28:06 (GMT) |
commit | c407ef0a8a829c4e506bf43e412df176cc8cc2c0 (patch) | |
tree | c4835469475601726a39ed8937760645e19eebfe /Grammar | |
parent | 025c9912eeecc8b2584bc5143150fc548db2254b (diff) | |
download | cpython-c407ef0a8a829c4e506bf43e412df176cc8cc2c0.zip cpython-c407ef0a8a829c4e506bf43e412df176cc8cc2c0.tar.gz cpython-c407ef0a8a829c4e506bf43e412df176cc8cc2c0.tar.bz2 |
[3.12] gh-98931: Add custom error messages to invalid import/from with multiple targets (GH-105985) (#105991)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Diffstat (limited to 'Grammar')
-rw-r--r-- | Grammar/python.gram | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Grammar/python.gram b/Grammar/python.gram index 6b2a46a..c1863ae 100644 --- a/Grammar/python.gram +++ b/Grammar/python.gram @@ -1293,7 +1293,7 @@ invalid_group: | '(' a='**' expression ')' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "cannot use double starred expression here") } invalid_import: - | a='import' dotted_name 'from' dotted_name { + | a='import' ','.dotted_name+ 'from' dotted_name { RAISE_SYNTAX_ERROR_STARTING_FROM(a, "Did you mean to use 'from ... import ...' instead?") } invalid_import_from_targets: |