diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-07-20 21:20:43 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-07-20 21:20:43 +0000 |
commit | 9281fc791f0e5c0463656ed18e7c5cc7457714b2 (patch) | |
tree | 56fb04453485d0506a75ba8a307556e8631d1656 /numpy/core/src/arraymethods.c | |
parent | 3a4fd7e82ca5b200e7b7eeb92343e32b4e8891b6 (diff) | |
download | numpy-9281fc791f0e5c0463656ed18e7c5cc7457714b2.tar.gz |
Change file reading and writing to call file object instead of using PyFile_FromString
Diffstat (limited to 'numpy/core/src/arraymethods.c')
-rw-r--r-- | numpy/core/src/arraymethods.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/numpy/core/src/arraymethods.c b/numpy/core/src/arraymethods.c index c01d3db4b..e13061a4e 100644 --- a/numpy/core/src/arraymethods.c +++ b/numpy/core/src/arraymethods.c @@ -440,16 +440,14 @@ array_tofile(PyArrayObject *self, PyObject *args, PyObject *kwds) FILE *fd; char *sep=""; char *format=""; - char *mode=""; static char *kwlist[] = {"file", "sep", "format", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|ss", kwlist, &file, &sep, &format)) return NULL; if (PyString_Check(file)) { - if (sep == "") mode="wb"; - else mode="w"; - file = PyFile_FromString(PyString_AS_STRING(file), mode); + file = PyObject_CallFunction((PyObject *)&PyFile_Type, + "Os", file, "wb"); if (file==NULL) return NULL; } else { |