diff options
author | Brett Cannon <brett@python.org> | 2016-09-08 00:00:43 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2016-09-08 00:00:43 (GMT) |
commit | 52794db825caa62e1a066dce4bd95bde2fe80216 (patch) | |
tree | 644171fd9efac506f5ac3ee74b360fd27e6af741 /Python/import.c | |
parent | 46f97b85a8ce9ae67b6e4bc32e94f7827df7bab7 (diff) | |
download | cpython-52794db825caa62e1a066dce4bd95bde2fe80216.zip cpython-52794db825caa62e1a066dce4bd95bde2fe80216.tar.gz cpython-52794db825caa62e1a066dce4bd95bde2fe80216.tar.bz2 |
Issue #27911: Remove some unnecessary error checks in import.c.
Thanks to Xiang Zhang for the patch.
Diffstat (limited to 'Python/import.c')
-rw-r--r-- | Python/import.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Python/import.c b/Python/import.c index c780fe2..17188c2 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); } |