summaryrefslogtreecommitdiffstats
path: root/Modules/pyexpat.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-06-12 23:30:11 (GMT)
committerGuido van Rossum <guido@python.org>2007-06-12 23:30:11 (GMT)
commitda5b8f2d28f2f7ce47be5d88244eaefc66f7de3e (patch)
treef3b0ab1f90be8ba18b1cefdb660cebd95c0f70d9 /Modules/pyexpat.c
parent2d5c219fe09eacf81c139e5af9114fbbdd093d85 (diff)
downloadcpython-da5b8f2d28f2f7ce47be5d88244eaefc66f7de3e.zip
cpython-da5b8f2d28f2f7ce47be5d88244eaefc66f7de3e.tar.gz
cpython-da5b8f2d28f2f7ce47be5d88244eaefc66f7de3e.tar.bz2
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/pyexpat.c')
-rw-r--r--Modules/pyexpat.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
index aebae1c..c583edf 100644
--- a/Modules/pyexpat.c
+++ b/Modules/pyexpat.c
@@ -956,10 +956,7 @@ xmlparse_ParseFile(xmlparseobject *self, PyObject *f)
FILE *fp;
PyObject *readmethod = NULL;
- if (PyFile_Check(f)) {
- fp = PyFile_AsFile(f);
- }
- else {
+ {
fp = NULL;
readmethod = PyObject_GetAttrString(f, "read");
if (readmethod == NULL) {