]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
closes bpo-39262: Use specific out-of-memory message in _sharedexception_bind. (GH...
authorAlex Henrie <alexhenrie24@gmail.com>
Thu, 9 Jan 2020 02:48:52 +0000 (02:48 +0000)
committerBenjamin Peterson <benjamin@python.org>
Thu, 9 Jan 2020 02:48:52 +0000 (18:48 -0800)
Modules/_xxsubinterpretersmodule.c

index 4a6ffdd3266783a7359d90eac8d5f81c63f4e7f2..fa20bc5dcec57e9eb6fb09a90c7e10b92801e7e4 100644 (file)
@@ -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;
         }
     }