From 52794db825caa62e1a066dce4bd95bde2fe80216 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 7 Sep 2016 17:00:43 -0700 Subject: Issue #27911: Remove some unnecessary error checks in import.c. Thanks to Xiang Zhang for the patch. --- Python/import.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'Python/import.c') diff --git a/Python/import.c b/Python/import.c index c780fe2976..17188c275a 100644 --- a/Python/import.c +++ b/Python/import.c @@ -1942,19 +1942,15 @@ exec_builtin_or_dynamic(PyObject *mod) { def = PyModule_GetDef(mod); if (def == NULL) { - if (PyErr_Occurred()) { - return -1; - } return 0; } + state = PyModule_GetState(mod); - if (PyErr_Occurred()) { - return -1; - } if (state) { /* Already initialized; skip reload */ return 0; } + return PyModule_ExecDef(mod, def); } -- cgit v1.2.1