@@ -94,9 +94,9 @@ def writetb(self, lines: Iterable[str]) -> None:
94
94
# TODO for tracebacks get_lexer_by_name("pytb", stripall=True)
95
95
96
96
def format (self , tbtext : str , lexer : Any ) -> None :
97
- # FIXME: lexer should is a Lexer
97
+ # FIXME: lexer should be " Lexer"
98
98
traceback_informative_formatter = BPythonFormatter (default_colors )
99
- traceback_code_formatter = BPythonFormatter ({Token : ( "d" ) })
99
+ traceback_code_formatter = BPythonFormatter ({Token : "d" })
100
100
101
101
no_format_mode = False
102
102
cur_line = []
@@ -111,7 +111,7 @@ def format(self, tbtext: str, lexer: Any) -> None:
111
111
cur_line , self .outfile
112
112
)
113
113
cur_line = []
114
- elif text == " " and cur_line == [] :
114
+ elif text == " " and len ( cur_line ) == 0 :
115
115
no_format_mode = True
116
116
cur_line .append ((token , text ))
117
117
else :
@@ -130,9 +130,6 @@ def code_finished_will_parse(
130
130
False, True means code block is unfinished
131
131
False, False isn't possible - an predicted error makes code block done"""
132
132
try :
133
- finished = bool (compiler (s ))
134
- code_will_parse = True
133
+ return bool (compiler (s )), True
135
134
except (ValueError , SyntaxError , OverflowError ):
136
- finished = True
137
- code_will_parse = False
138
- return finished , code_will_parse
135
+ return True , False
0 commit comments