@@ -406,24 +406,21 @@ int
406406_Py_WriteIndentedMargin (int indent , const char * margin , PyObject * f )
407407{
408408 if (_Py_WriteIndent (indent , f ) < 0 ) {
409- goto error ;
409+ return -1 ;
410410 }
411411 if (margin ) {
412412 if (PyFile_WriteString (margin , f ) < 0 ) {
413- goto error ;
413+ return -1 ;
414414 }
415415 }
416416 return 0 ;
417- error :
418- return -1 ;
419417}
420418
421419static int
422420display_source_line_with_margin (PyObject * f , PyObject * filename , int lineno , int indent ,
423421 int margin_indent , const char * margin ,
424422 int * truncation , PyObject * * line )
425423{
426- int err = 0 ;
427424 int fd ;
428425 int i ;
429426 char * found_encoding ;
@@ -506,7 +503,6 @@ display_source_line_with_margin(PyObject *f, PyObject *filename, int lineno, int
506503 lineobj = PyFile_GetLine (fob , -1 );
507504 if (!lineobj ) {
508505 PyErr_Clear ();
509- err = -1 ;
510506 break ;
511507 }
512508 }
@@ -520,7 +516,7 @@ display_source_line_with_margin(PyObject *f, PyObject *filename, int lineno, int
520516 Py_DECREF (fob );
521517 if (!lineobj || !PyUnicode_Check (lineobj )) {
522518 Py_XDECREF (lineobj );
523- return err ;
519+ return -1 ;
524520 }
525521
526522 if (line ) {
@@ -551,8 +547,6 @@ display_source_line_with_margin(PyObject *f, PyObject *filename, int lineno, int
551547 * truncation = i - indent ;
552548 }
553549
554- assert (!err );
555-
556550 if (_Py_WriteIndentedMargin (margin_indent , margin , f ) < 0 ) {
557551 goto error ;
558552 }
0 commit comments