From a248a549a703cb7f9e4d3df8c55705c01f09d214 Mon Sep 17 00:00:00 2001 From: isidentical Date: Sat, 13 Jul 2019 15:12:55 +0300 Subject: [PATCH] bpo35476: clear error in _imp_create_dynamic_impl --- Python/import.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Python/import.c b/Python/import.c index 3937fbe37d9417..58c5b962013bee 100644 --- a/Python/import.c +++ b/Python/import.c @@ -2249,6 +2249,9 @@ _imp_create_dynamic_impl(PyObject *module, PyObject *spec, PyObject *file) mod = _PyImport_FindExtensionObject(name, path); if (mod != NULL || PyErr_Occurred()) { + if (PyErr_Occurred()) { + PyErr_Clear(); + } Py_DECREF(name); Py_DECREF(path); Py_XINCREF(mod);