summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2015-06-19 13:38:22 -0600
committerCharles Harris <charlesr.harris@gmail.com>2015-06-21 12:43:06 -0600
commit5b8ec8915ef5e2fa58824411be4ea1e17736d08a (patch)
treef2b5a5efa131b5d3d114e3f782dfc236403249f3 /numpy
parent4027d16f0aa19e551067bf0c93dbe057e0142bb8 (diff)
downloadnumpy-5b8ec8915ef5e2fa58824411be4ea1e17736d08a.tar.gz
DEP,MAINT: Remove deprecated functions from npy_3kcompat.h
These functions npy_PyFile_Dup and npy_PyFile_DupClose do not work correctly in Python 3. Deprecation messages have been raised in npy_PyFile_Dup since 1.9 and it is probably best to smoke out any remaining uses by simply removing the function.
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/include/numpy/npy_3kcompat.h45
1 files changed, 0 insertions, 45 deletions
diff --git a/numpy/core/include/numpy/npy_3kcompat.h b/numpy/core/include/numpy/npy_3kcompat.h
index ef5b5694c..72ddaf66b 100644
--- a/numpy/core/include/numpy/npy_3kcompat.h
+++ b/numpy/core/include/numpy/npy_3kcompat.h
@@ -272,35 +272,8 @@ npy_PyFile_Check(PyObject *file)
return 1;
}
-/*
- * DEPRECATED DO NOT USE
- * use npy_PyFile_DupClose2 instead
- * this function will mess ups python3 internal file object buffering
- * Close the dup-ed file handle, and seek the Python one to the current position
- */
-static NPY_INLINE int
-npy_PyFile_DupClose(PyObject *file, FILE* handle)
-{
- PyObject *ret;
- Py_ssize_t position;
- position = npy_ftell(handle);
- fclose(handle);
-
- ret = PyObject_CallMethod(file, "seek", NPY_SSIZE_T_PYFMT "i", position, 0);
- if (ret == NULL) {
- return -1;
- }
- Py_DECREF(ret);
- return 0;
-}
-
-
#else
-/* DEPRECATED, DO NOT USE */
-#define npy_PyFile_DupClose(f, h) npy_PyFile_DupClose2((f), (h), 0)
-
-/* use these */
static NPY_INLINE FILE *
npy_PyFile_Dup2(PyObject *file,
const char *NPY_UNUSED(mode), npy_off_t *NPY_UNUSED(orig_pos))
@@ -319,24 +292,6 @@ npy_PyFile_DupClose2(PyObject *NPY_UNUSED(file), FILE* NPY_UNUSED(handle),
#endif
-/*
- * DEPRECATED, DO NOT USE
- * Use npy_PyFile_Dup2 instead.
- * This function will mess up python3 internal file object buffering.
- * Get a FILE* handle to the file represented by the Python object.
- */
-static NPY_INLINE FILE*
-npy_PyFile_Dup(PyObject *file, char *mode)
-{
- npy_off_t orig;
- if (DEPRECATE("npy_PyFile_Dup is deprecated, use "
- "npy_PyFile_Dup2") < 0) {
- return NULL;
- }
-
- return npy_PyFile_Dup2(file, mode, &orig);
-}
-
static NPY_INLINE PyObject*
npy_PyFile_OpenFile(PyObject *filename, const char *mode)
{