summaryrefslogtreecommitdiffstats
path: root/Modules/_io
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-03-24 09:27:50 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-03-24 09:27:50 (GMT)
commitf329878e74e1eefffad5c70942bc6cd2c27440d3 (patch)
tree398feb83dc1f8a2a8e15a4cd356748fe86219639 /Modules/_io
parent551350a79f1a85d78467740b348fa1cdeb7519e4 (diff)
downloadcpython-f329878e74e1eefffad5c70942bc6cd2c27440d3.zip
cpython-f329878e74e1eefffad5c70942bc6cd2c27440d3.tar.gz
cpython-f329878e74e1eefffad5c70942bc6cd2c27440d3.tar.bz2
Issue #23753: Python doesn't support anymore platforms without stat() or
fstat(), these functions are always required. Remove HAVE_STAT and HAVE_FSTAT defines, and stop supporting DONT_HAVE_STAT and DONT_HAVE_FSTAT.
Diffstat (limited to 'Modules/_io')
-rw-r--r--Modules/_io/fileio.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c
index 6152cde..b35a51b 100644
--- a/Modules/_io/fileio.c
+++ b/Modules/_io/fileio.c
@@ -180,7 +180,6 @@ fileio_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
static int
check_fd(int fd)
{
-#if defined(HAVE_FSTAT) || defined(MS_WINDOWS)
struct _Py_stat_struct buf;
if (_Py_fstat(fd, &buf) < 0 &&
#ifdef MS_WINDOWS
@@ -197,7 +196,6 @@ check_fd(int fd)
Py_XDECREF(exc);
return -1;
}
-#endif
return 0;
}
@@ -228,9 +226,7 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
#elif !defined(MS_WINDOWS)
int *atomic_flag_works = NULL;
#endif
-#if defined(HAVE_FSTAT) || defined(MS_WINDOWS)
struct _Py_stat_struct fdfstat;
-#endif
int async_err = 0;
assert(PyFileIO_Check(oself));
@@ -427,7 +423,6 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
}
self->blksize = DEFAULT_BUFFER_SIZE;
-#if defined(HAVE_FSTAT) || defined(MS_WINDOWS)
if (_Py_fstat(self->fd, &fdfstat) < 0) {
PyErr_SetFromErrno(PyExc_OSError);
goto error;
@@ -446,7 +441,6 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
if (fdfstat.st_blksize > 1)
self->blksize = fdfstat.st_blksize;
#endif /* HAVE_STRUCT_STAT_ST_BLKSIZE */
-#endif /* HAVE_FSTAT || MS_WINDOWS */
#if defined(MS_WINDOWS) || defined(__CYGWIN__)
/* don't translate newlines (\r\n <=> \n) */
@@ -597,8 +591,6 @@ fileio_readinto(fileio *self, PyObject *args)
return PyLong_FromSsize_t(n);
}
-#if defined(HAVE_FSTAT) || defined(MS_WINDOWS)
-
static size_t
new_buffersize(fileio *self, size_t currentsize)
{
@@ -702,18 +694,6 @@ fileio_readall(fileio *self)
return result;
}
-#else
-
-static PyObject *
-fileio_readall(fileio *self)
-{
- _Py_IDENTIFIER(readall);
- return _PyObject_CallMethodId((PyObject*)&PyRawIOBase_Type,
- &PyId_readall, "O", self);
-}
-
-#endif /* HAVE_FSTAT || MS_WINDOWS */
-
static PyObject *
fileio_read(fileio *self, PyObject *args)
{