diff Python/_warnings.c @ 48474:2ee09afee126

implement chained exception tracebacks patch from Antoine Pitrou #3112
author Benjamin Peterson <benjamin@python.org>
date Tue, 15 Jul 2008 15:32:09 +0000
parents 605ab6f92838
children de0bf60f1245
line wrap: on
line diff
--- a/Python/_warnings.c	Tue Jul 15 14:31:20 2008 +0000
+++ b/Python/_warnings.c	Tue Jul 15 15:32:09 2008 +0000
@@ -256,7 +256,6 @@
     Py_XDECREF(name);
 
     /* Print "  source_line\n" */
-    PyFile_WriteString("  ", f_stderr);
     if (sourceline) {
         char *source_line_str = PyUnicode_AsString(sourceline);
         while (*source_line_str == ' ' || *source_line_str == '\t' ||
@@ -267,7 +266,7 @@
         PyFile_WriteString("\n", f_stderr);
     }
     else
-        Py_DisplaySourceLine(f_stderr, PyUnicode_AsString(filename), lineno);
+        Py_DisplaySourceLine(f_stderr, PyUnicode_AsString(filename), lineno, 2);
     PyErr_Clear();
 }