diff Python/pythonrun.c @ 41126:a87bcc37bf0f legacy-trunk

Bug #1678647: write a newline after printing an exception in any case, even when converting the value to a string failed.
author Georg Brandl <georg@python.org>
date Mon, 12 Mar 2007 14:30:05 +0000
parents c8ed4aea6c58
children 45ce388ec59a
line wrap: on
line diff
--- a/Python/pythonrun.c	Mon Mar 12 13:17:36 2007 +0000
+++ b/Python/pythonrun.c	Mon Mar 12 14:30:05 2007 +0000
@@ -1226,8 +1226,8 @@
 			  err = PyFile_WriteObject(s, f, Py_PRINT_RAW);
 			Py_XDECREF(s);
 		}
-		if (err == 0)
-			err = PyFile_WriteString("\n", f);
+		/* try to write a newline in any case */
+		err += PyFile_WriteString("\n", f);
 	}
 	Py_DECREF(value);
 	/* If an error happened here, don't show it.