diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2004-06-03 12:47:26 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2004-06-03 12:47:26 (GMT) |
commit | 77ca6c4c8483c22c6ba6200a94e9628671c82a3d (patch) | |
tree | ad04aa4c13ca4097b09d95a955c4ebe8c90e6820 /Modules | |
parent | 6b08a40442ca500c8e2073e012b51af66cab9c5a (diff) | |
download | cpython-77ca6c4c8483c22c6ba6200a94e9628671c82a3d.zip cpython-77ca6c4c8483c22c6ba6200a94e9628671c82a3d.tar.gz cpython-77ca6c4c8483c22c6ba6200a94e9628671c82a3d.tar.bz2 |
Warn abou missing mutate flag to ioctl. Fixes #696535.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/fcntlmodule.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Modules/fcntlmodule.c b/Modules/fcntlmodule.c index 9894c43..43f1773 100644 --- a/Modules/fcntlmodule.c +++ b/Modules/fcntlmodule.c @@ -108,7 +108,13 @@ fcntl_ioctl(PyObject *self, PyObject *args) char *arg; if (PyTuple_Size(args) == 3) { - /* warning goes here in 2.4 */ +#if (PY_MAJOR_VERSION>2) || (PY_MINOR_VERSION>=5) +#error Remove the warning, change mutate_arg to 1 +#endif + if (PyErr_Warn(PyExc_FutureWarning, + "ioctl with mutable buffer will mutate the buffer by default in 2.5" + ) < 0) + return NULL; mutate_arg = 0; } if (mutate_arg) { |