diff Python/_warnings.c @ 47933:4f804ee772eb legacy-trunk

#3342: In tracebacks, printed source lines were not indented since r62555. #3343: Py_DisplaySourceLine should be a private function. Rename it to _Py_DisplaySourceLine.
author Amaury Forgeot d'Arc <amauryfa@gmail.com>
date Fri, 11 Jul 2008 21:45:06 +0000
parents dc42efd728ee
children d563621d76db
line wrap: on
line diff
--- a/Python/_warnings.c	Fri Jul 11 21:28:25 2008 +0000
+++ b/Python/_warnings.c	Fri Jul 11 21:45:06 2008 +0000
@@ -256,7 +256,6 @@
     Py_XDECREF(name);
 
     /* Print "  source_line\n" */
-    PyFile_WriteString("  ", f_stderr);
     if (sourceline) {
         char *source_line_str = PyString_AS_STRING(sourceline);
         while (*source_line_str == ' ' || *source_line_str == '\t' ||
@@ -267,7 +266,8 @@
         PyFile_WriteString("\n", f_stderr);
     }
     else
-        Py_DisplaySourceLine(f_stderr, PyString_AS_STRING(filename), lineno);
+        _Py_DisplaySourceLine(f_stderr, PyString_AS_STRING(filename), 
+                              lineno, 2);
     PyErr_Clear();
 }