@@ -1277,13 +1277,13 @@ def format_exception_only(self, *, show_group=False, _depth=0, **kwargs):
1277
1277
if self .exceptions and show_group :
1278
1278
for ex in self .exceptions :
1279
1279
yield from ex .format_exception_only (show_group = show_group , _depth = _depth + 1 , colorize = colorize )
1280
-
1280
+
1281
1281
def _find_keyword_typos (self ):
1282
1282
try :
1283
1283
import _suggestions
1284
1284
except ImportError :
1285
1285
return
1286
-
1286
+
1287
1287
assert self ._is_syntax_error
1288
1288
1289
1289
# Only try to find keyword typos if there is no custom message
@@ -1292,7 +1292,7 @@ def _find_keyword_typos(self):
1292
1292
1293
1293
if not self ._exc_metadata :
1294
1294
return
1295
-
1295
+
1296
1296
line , offset , source = self ._exc_metadata
1297
1297
end_line = int (self .lineno ) if self .lineno is not None else 0
1298
1298
lines = None
@@ -1310,7 +1310,7 @@ def _find_keyword_typos(self):
1310
1310
lines = lines if lines is not None else self .text .splitlines ()
1311
1311
else :
1312
1312
lines = source .splitlines ()
1313
-
1313
+
1314
1314
error_code = lines [line - 1 if line > 0 else 0 :end_line ]
1315
1315
error_code [0 ] = error_code [0 ][offset :]
1316
1316
error_code = textwrap .dedent ('' .join (error_code ))
@@ -1356,7 +1356,7 @@ def _find_keyword_typos(self):
1356
1356
self .end_lineno = end [0 ]
1357
1357
self .msg = f"invalid syntax. Did you mean '{ suggestion } '?"
1358
1358
return
1359
-
1359
+
1360
1360
1361
1361
def _format_syntax_error (self , stype , ** kwargs ):
1362
1362
"""Format SyntaxError exceptions (internal helper)."""
0 commit comments