[Python-checkins] bpo-38631: Avoid Py_FatalError() in _multibytecodec init (GH-17233)

Victor Stinner webhook-mailer at python.org
Mon Nov 18 11:40:12 EST 2019


https://github.com/python/cpython/commit/bc7d3aa6d74b718699b7a6bced9b0dfdfbf95c13
commit: bc7d3aa6d74b718699b7a6bced9b0dfdfbf95c13
branch: master
author: Victor Stinner <vstinner at python.org>
committer: GitHub <noreply at github.com>
date: 2019-11-18T17:40:07+01:00
summary:

bpo-38631: Avoid Py_FatalError() in _multibytecodec init (GH-17233)

If an exception is raised and PyInit__multibytecodec() returns NULL,
Python reports properly the exception to the user. There is no need
to crash Python with Py_FatalError().

files:
M Modules/cjkcodecs/multibytecodec.c

diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c
index 56d007607e218..f24ec933508f1 100644
--- a/Modules/cjkcodecs/multibytecodec.c
+++ b/Modules/cjkcodecs/multibytecodec.c
@@ -2085,7 +2085,6 @@ PyInit__multibytecodec(void)
     }
 
     if (PyErr_Occurred()) {
-        Py_FatalError("can't initialize the _multibytecodec module");
         Py_DECREF(m);
         m = NULL;
     }



More information about the Python-checkins mailing list