summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 4008a28..e2852328 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -110,6 +110,9 @@ PySys_GetObject(const char *name)
PyObject *value = _PySys_GetObject(tstate->interp, name);
/* XXX Suppress a new exception if it was raised and restore
* the old one. */
+ if (_PyErr_Occurred(tstate)) {
+ PyErr_FormatUnraisable("Exception ignored in PySys_GetObject()");
+ }
_PyErr_SetRaisedException(tstate, exc);
return value;
}