[Python-checkins] closes bpo-39262: Use specific out-of-memory message in _sharedexception_bind. (GH-17908)

Miss Islington (bot) webhook-mailer at python.org
Wed Jan 8 22:07:45 EST 2020


https://github.com/python/cpython/commit/45e5750a013291c5729e0ebad2b9e340fdffbd36
commit: 45e5750a013291c5729e0ebad2b9e340fdffbd36
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020-01-08T19:07:38-08:00
summary:

closes bpo-39262: Use specific out-of-memory message in _sharedexception_bind. (GH-17908)

(cherry picked from commit 5cae042f686cc174e00093944dc118914c874b7c)

Co-authored-by: Alex Henrie <alexhenrie24 at gmail.com>

files:
M Modules/_xxsubinterpretersmodule.c

diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c
index 7842947e54ac5..db1116ac6e352 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;
         }
     }



More information about the Python-checkins mailing list