summaryrefslogtreecommitdiff
path: root/Modules/_cursesmodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-06-12 23:30:11 +0000
committerGuido van Rossum <guido@python.org>2007-06-12 23:30:11 +0000
commitda5b8f2d28f2f7ce47be5d88244eaefc66f7de3e (patch)
treef3b0ab1f90be8ba18b1cefdb660cebd95c0f70d9 /Modules/_cursesmodule.c
parent2d5c219fe09eacf81c139e5af9114fbbdd093d85 (diff)
downloadcpython-git-da5b8f2d28f2f7ce47be5d88244eaefc66f7de3e.tar.gz
Rip out the file object's implementation.
Fixed test_import.py while I was at it. However, there's still a problem in import.c -- get_file() can leak a FILE struct (not a file descriptor though). I'm not sure how to fix this; closing the FILE* closes the file descriptor, and that's the wrong thing to do when there's still a Python file object keeping the file descriptor open. I also would rather not mess with dup(), as it won't port to Windows.
Diffstat (limited to 'Modules/_cursesmodule.c')
-rw-r--r--Modules/_cursesmodule.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index 918e22d1b5..2680320f07 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -1287,12 +1287,13 @@ PyCursesWindow_PutWin(PyCursesWindowObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "O;fileobj", &temp))
return NULL;
- if (!PyFile_Check(temp)) {
- PyErr_SetString(PyExc_TypeError, "argument must be a file object");
- return NULL;
- }
+ PyErr_SetString(PyExc_TypeError, "argument must be a file object");
+ return NULL;
+
+#if 0
return PyCursesCheckERR(putwin(self->win, PyFile_AsFile(temp)),
"putwin");
+#endif
}
static PyObject *
@@ -1748,11 +1749,10 @@ PyCurses_GetWin(PyCursesWindowObject *self, PyObject *temp)
PyCursesInitialised
- if (!PyFile_Check(temp)) {
- PyErr_SetString(PyExc_TypeError, "argument must be a file object");
- return NULL;
- }
+ PyErr_SetString(PyExc_TypeError, "argument must be a file object");
+ return NULL;
+#if 0
win = getwin(PyFile_AsFile(temp));
if (win == NULL) {
@@ -1761,6 +1761,7 @@ PyCurses_GetWin(PyCursesWindowObject *self, PyObject *temp)
}
return PyCursesWindow_New(win);
+#endif
}
static PyObject *