From: Alex Henrie Date: Thu, 9 Jan 2020 02:48:52 +0000 (+0000) Subject: closes bpo-39262: Use specific out-of-memory message in _sharedexception_bind. (GH... X-Git-Tag: v3.9.0a3~116 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5cae042f686cc174e00093944dc118914c874b7c;p=thirdparty%2FPython%2Fcpython.git closes bpo-39262: Use specific out-of-memory message in _sharedexception_bind. (GH-17908) --- diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c index 4a6ffdd32667..fa20bc5dcec5 100644 --- a/Modules/_xxsubinterpretersmodule.c +++ b/Modules/_xxsubinterpretersmodule.c @@ -221,8 +221,9 @@ _sharedexception_bind(PyObject *exctype, PyObject *exc, PyObject *tb) if (err->name == NULL) { if (PyErr_ExceptionMatches(PyExc_MemoryError)) { failure = "out of memory copying exception type name"; + } else { + failure = "unable to encode and copy exception type name"; } - failure = "unable to encode and copy exception type name"; goto finally; } @@ -237,8 +238,9 @@ _sharedexception_bind(PyObject *exctype, PyObject *exc, PyObject *tb) if (err->msg == NULL) { if (PyErr_ExceptionMatches(PyExc_MemoryError)) { failure = "out of memory copying exception message"; + } else { + failure = "unable to encode and copy exception message"; } - failure = "unable to encode and copy exception message"; goto finally; } }