summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-06-09 06:13:04 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-06-09 06:13:04 (GMT)
commit8a8f7f983099f172d1f7c25d4fd99f5c0eb14072 (patch)
treeece2ee26d3edfee06c27e325f7aff80cf9c2adfb /Modules
parentb1f59cecc97000396604a3852804932512598938 (diff)
downloadcpython-8a8f7f983099f172d1f7c25d4fd99f5c0eb14072.zip
cpython-8a8f7f983099f172d1f7c25d4fd99f5c0eb14072.tar.gz
cpython-8a8f7f983099f172d1f7c25d4fd99f5c0eb14072.tar.bz2
Issue #21677: Fixed chaining nonnormalized exceptions in io close() methods.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_io/bufferedio.c1
-rw-r--r--Modules/_io/textio.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c
index 7494646..d0e92e5 100644
--- a/Modules/_io/bufferedio.c
+++ b/Modules/_io/bufferedio.c
@@ -549,6 +549,7 @@ buffered_close(buffered *self, PyObject *args)
}
else {
PyObject *val2;
+ PyErr_NormalizeException(&exc, &val, &tb);
Py_DECREF(exc);
Py_XDECREF(tb);
PyErr_Fetch(&exc, &val2, &tb);
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c
index ba5789d..55392b4 100644
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -2614,6 +2614,7 @@ textiowrapper_close(textio *self, PyObject *args)
}
else {
PyObject *val2;
+ PyErr_NormalizeException(&exc, &val, &tb);
Py_DECREF(exc);
Py_XDECREF(tb);
PyErr_Fetch(&exc, &val2, &tb);