commit | bf00bc783fd87544c1717b2db163736cea6412aa | [log] [tgz] |
---|---|---|
author | Eric Snow <ericsnowcurrently@gmail.com> | Wed Sep 07 19:08:02 2016 -0700 |
committer | Eric Snow <ericsnowcurrently@gmail.com> | Wed Sep 07 19:08:02 2016 -0700 |
tree | 293b139cca275b02148ef35ffa7fe2bd0e2a2489 | |
parent | 280bc223b4b5df841da20faafd1b63cde2694acd [diff] [blame] |
Issue #15578: Correctly incref the parent module while importing.
diff --git a/Python/import.c b/Python/import.c index 96f7d47..af47b0b 100644 --- a/Python/import.c +++ b/Python/import.c
@@ -2243,8 +2243,10 @@ if (parent == NULL) goto error_exit; + Py_INCREF(parent); head = load_next(parent, level < 0 ? Py_None : parent, &name, buf, &buflen); + Py_DECREF(parent); if (head == NULL) goto error_exit;