summaryrefslogtreecommitdiff
path: root/Python/errors.c
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2012-11-10 15:13:20 -0800
committerGregory P. Smith <greg@krypto.org>2012-11-10 15:13:20 -0800
commitba4bab5e5e33be325055cd24f13cf6b8cafc70e9 (patch)
tree707e4abeeffa0acf0ab39c99b1afb92cffe537ab /Python/errors.c
parent6036726804846afff30398bc8f5a9d9fd286924c (diff)
parentb95b5efc8d6714b0ef39fe0743203c608a9467a8 (diff)
downloadcpython-ba4bab5e5e33be325055cd24f13cf6b8cafc70e9.tar.gz
Fix test_urllib broken by my previous commits. The assumptions it was
testing were added as part of the issue10050 change that caused the wrong behavior in the first place. now all test cases agree on the behavior.
Diffstat (limited to 'Python/errors.c')
-rw-r--r--Python/errors.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/Python/errors.c b/Python/errors.c
index 626b16e46f..a2d1a82ddf 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -798,7 +798,12 @@ PyErr_WriteUnraisable(PyObject *obj)
PyErr_Fetch(&t, &v, &tb);
f = PySys_GetObject("stderr");
if (f != NULL && f != Py_None) {
- PyFile_WriteString("Exception ", f);
+ if (obj) {
+ PyFile_WriteString("Exception ignored in: ", f);
+ PyFile_WriteObject(obj, f, 0);
+ PyFile_WriteString("\n", f);
+ }
+ PyTraceBack_Print(tb, f);
if (t) {
PyObject* moduleName;
char* className;
@@ -828,15 +833,11 @@ PyErr_WriteUnraisable(PyObject *obj)
PyFile_WriteString(className, f);
if (v && v != Py_None) {
PyFile_WriteString(": ", f);
- PyFile_WriteObject(v, f, 0);
+ PyFile_WriteObject(v, f, Py_PRINT_RAW);
}
+ PyFile_WriteString("\n", f);
Py_XDECREF(moduleName);
}
- if (obj) {
- PyFile_WriteString(" in ", f);
- PyFile_WriteObject(obj, f, 0);
- }
- PyFile_WriteString(" ignored\n", f);
PyErr_Clear(); /* Just in case */
}
Py_XDECREF(t);