diff options
author | Alex Henrie <alexhenrie24@gmail.com> | 2020-01-09 02:48:52 +0000 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2020-01-08 18:48:52 -0800 |
commit | 5cae042f686cc174e00093944dc118914c874b7c (patch) | |
tree | 2bd2313b391c106ddfc8a1acfe6d32adce8b7f3a | |
parent | 2c7ed417a4c758f1c3f97fcbca70a49f79e58c07 (diff) | |
download | cpython-git-5cae042f686cc174e00093944dc118914c874b7c.tar.gz |
closes bpo-39262: Use specific out-of-memory message in _sharedexception_bind. (GH-17908)
-rw-r--r-- | Modules/_xxsubinterpretersmodule.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c index 4a6ffdd326..fa20bc5dce 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; } } |