summaryrefslogtreecommitdiffstats
path: root/Modules/_io
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_io')
-rw-r--r--Modules/_io/_iomodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c
index ca359bc..6d7121c 100644
--- a/Modules/_io/_iomodule.c
+++ b/Modules/_io/_iomodule.c
@@ -453,7 +453,7 @@ io_open(PyObject *self, PyObject *args, PyObject *kwds)
if (fileno == -1 && PyErr_Occurred())
goto error;
- if (fstat(fileno, &st) >= 0)
+ if (fstat(fileno, &st) >= 0 && st.st_blksize > 1)
buffering = st.st_blksize;
}
#endif