diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-10-30 17:55:24 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-10-30 17:55:24 (GMT) |
commit | f0a7bac20174f602280cf4edb70bb8fe7480e2b0 (patch) | |
tree | 8381a3740a160c056218db46a35f835bbce01246 | |
parent | a6b9b071a3f9cd358a29846fb655e310d7af692a (diff) | |
download | cpython-f0a7bac20174f602280cf4edb70bb8fe7480e2b0.zip cpython-f0a7bac20174f602280cf4edb70bb8fe7480e2b0.tar.gz cpython-f0a7bac20174f602280cf4edb70bb8fe7480e2b0.tar.bz2 |
Issue #19437: Fix os.statvfs(), handle errors
-rw-r--r-- | Modules/posixmodule.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index d5b5235..789bf27b 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -9173,6 +9173,10 @@ _pystatvfs_fromstructstatvfs(struct statvfs st) { PyStructSequence_SET_ITEM(v, 8, PyLong_FromLong((long) st.f_flag)); PyStructSequence_SET_ITEM(v, 9, PyLong_FromLong((long) st.f_namemax)); #endif + if (PyErr_Occurred()) { + Py_DECREF(v); + return NULL; + } return v; } |