]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-38631: Avoid Py_FatalError() in PyModule_Create2() (GH-18212)
authorVictor Stinner <vstinner@python.org>
Mon, 27 Jan 2020 21:37:05 +0000 (22:37 +0100)
committerGitHub <noreply@github.com>
Mon, 27 Jan 2020 21:37:05 +0000 (22:37 +0100)
commita94c6b61aa5c09237b8105e5aee638cd54197b6f
treeed5a216fbd3bee7050dfec1b18fd029a57a1f887
parent4a46adc7746930c4589ee483cad88d3f8504c045
bpo-38631: Avoid Py_FatalError() in PyModule_Create2() (GH-18212)

If PyModule_Create2() is called when the Python import machinery is
not initialized, it now raises a SystemError and returns NULL,
instead of calling Py_FatalError() which aborts the process.

The caller must be prepared to handle NULL anyway.
Objects/moduleobject.c