commit | cdd8d4d6dd57f4c9429566706009d4613277d391 | [log] [tgz] |
---|---|---|
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | Mon Mar 25 14:36:43 2019 -0700 |
committer | Stefan Krah <skrah@bytereef.org> | Mon Mar 25 22:36:43 2019 +0100 |
tree | ef8ff48e6365df8353edb58c1bf3e7a902e33b25 | |
parent | f3c5535f63e7cd49166ab33b7b0ebb3285ef4ed0 [diff] [blame] |
bpo-36370: Check for PyErr_Occurred() after PyImport_GetModule() (GH-12504)
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index c01a04e..d87b4e2 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c
@@ -274,7 +274,9 @@ builtins = _PyImport_GetModuleId(&PyId_builtins); if (builtins == NULL) { - PyErr_SetString(PyExc_RuntimeError, "lost builtins module"); + if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_RuntimeError, "lost builtins module"); + } return NULL; } Py_DECREF(builtins);