diff options
Diffstat (limited to 'numpy/core')
-rw-r--r-- | numpy/core/include/numpy/npy_3kcompat.h | 45 |
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) { |