@@ -94,9 +94,9 @@ def writetb(self, lines: Iterable[str]) -> None:
9494 # TODO for tracebacks get_lexer_by_name("pytb", stripall=True)
9595
9696 def format (self , tbtext : str , lexer : Any ) -> None :
97- # FIXME: lexer should is a Lexer
97+ # FIXME: lexer should be " Lexer"
9898 traceback_informative_formatter = BPythonFormatter (default_colors )
99- traceback_code_formatter = BPythonFormatter ({Token : ( "d" ) })
99+ traceback_code_formatter = BPythonFormatter ({Token : "d" })
100100
101101 no_format_mode = False
102102 cur_line = []
@@ -111,7 +111,7 @@ def format(self, tbtext: str, lexer: Any) -> None:
111111 cur_line , self .outfile
112112 )
113113 cur_line = []
114- elif text == " " and cur_line == [] :
114+ elif text == " " and len ( cur_line ) == 0 :
115115 no_format_mode = True
116116 cur_line .append ((token , text ))
117117 else :
@@ -130,9 +130,6 @@ def code_finished_will_parse(
130130 False, True means code block is unfinished
131131 False, False isn't possible - an predicted error makes code block done"""
132132 try :
133- finished = bool (compiler (s ))
134- code_will_parse = True
133+ return bool (compiler (s )), True
135134 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