mirror of
https://github.com/python/cpython.git
synced 2025-11-08 17:41:42 +00:00
[3.14] gh-138318, PyREPL: builtins should not be highlighted when used as attribute names (GH-138319) (#138654)
gh-138318, PyREPL: builtins should not be highlighted when used as attribute names (GH-138319)
(cherry picked from commit 7a3bca50e0)
Co-authored-by: yihong <zouzou0208@gmail.com>
This commit is contained in:
parent
5074241f3d
commit
655ad1c63e
3 changed files with 30 additions and 2 deletions
|
|
@ -208,7 +208,10 @@ def gen_colors_from_token_stream(
|
|||
):
|
||||
span = Span.from_token(token, line_lengths)
|
||||
yield ColorSpan(span, "soft_keyword")
|
||||
elif token.string in BUILTINS:
|
||||
elif (
|
||||
token.string in BUILTINS
|
||||
and not (prev_token and prev_token.exact_type == T.DOT)
|
||||
):
|
||||
span = Span.from_token(token, line_lengths)
|
||||
yield ColorSpan(span, "builtin")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue