Skip to content

Commit 4cd4322

Browse files
authored
Merge pull request #24 from StanFromIreland/lazy-color
2 parents 8e4f292 + 510c200 commit 4cd4322

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Lib/_pyrepl/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def is_soft_keyword_used(*tokens: TI | None) -> bool:
276276
TI(T.NAME, string=s)
277277
):
278278
return not keyword.iskeyword(s)
279-
case (None | TI(T.NEWLINE) | TI(T.INDENT) | TI(T.DEDENT), TI(string="lazy"), TI(string="import")):
279+
case (None | TI(T.NEWLINE) | TI(T.INDENT) | TI(T.DEDENT), TI(string="lazy"), TI(string="import") | TI(string="from")):
280280
return True
281281
case _:
282282
return False

Lib/test/test_pyrepl/test_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ def test_gen_colors_keyword_highlighting(self):
9696
("list", [("list", "builtin")]),
9797
(" \n dict", [("dict", "builtin")]),
9898
(" lazy import", [("lazy", "soft_keyword"), ("import", "keyword")]),
99+
("lazy from cool_people import pablo", [('lazy', 'soft_keyword'), ('from', 'keyword'), ('import', 'keyword')])
99100
]
100101
for code, expected_highlights in cases:
101102
with self.subTest(code=code):

0 commit comments

Comments
 (0)