Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f0a7bac

Browse files
committed
Issue #19437: Fix os.statvfs(), handle errors
1 parent a6b9b07 commit f0a7bac

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Modules/posixmodule.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9173,6 +9173,10 @@ _pystatvfs_fromstructstatvfs(struct statvfs st) {
91739173
PyStructSequence_SET_ITEM(v, 8, PyLong_FromLong((long) st.f_flag));
91749174
PyStructSequence_SET_ITEM(v, 9, PyLong_FromLong((long) st.f_namemax));
91759175
#endif
9176+
if (PyErr_Occurred()) {
9177+
Py_DECREF(v);
9178+
return NULL;
9179+
}
91769180

91779181
return v;
91789182
}

0 commit comments

Comments
 (0)