Skip to content

Commit

Permalink
Fix for mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick91 committed Dec 31, 2021
1 parent 6c2510e commit a8ae7b5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rich/syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ def highlight(

def line_tokenize() -> Iterable[Tuple[Any, str]]:
"""Split tokens to one per line."""
assert lexer

for token_type, token in lexer.get_tokens(code):
while token:
line_token, new_line, token = token.partition("\n")
Expand Down Expand Up @@ -709,7 +711,7 @@ def __rich_console__(
code = sys.stdin.read()
syntax = Syntax(
code=code,
lexer_name=args.lexer_name,
lexer=args.lexer_name,
line_numbers=args.line_numbers,
word_wrap=args.word_wrap,
theme=args.theme,
Expand Down

0 comments on commit a8ae7b5

Please sign in to comment.