[Lxml-checkins] r54715 - in lxml/trunk: . src/lxml
scoder at codespeak.net
scoder at codespeak.net
Tue May 13 23:53:07 CEST 2008
Author: scoder
Date: Tue May 13 23:53:05 2008
New Revision: 54715
Modified:
lxml/trunk/ (props changed)
lxml/trunk/src/lxml/python.pxd
lxml/trunk/src/lxml/serializer.pxi
Log:
r4209 at delle: sbehnel | 2008-05-13 22:28:56 +0200
simplification
Modified: lxml/trunk/src/lxml/python.pxd
==============================================================================
--- lxml/trunk/src/lxml/python.pxd (original)
+++ lxml/trunk/src/lxml/python.pxd Tue May 13 23:53:05 2008
@@ -21,8 +21,6 @@
pass
cdef FILE* PyFile_AsFile(object p)
- cdef int PyFile_Check(object p)
- cdef object PyFile_Name(object p)
cdef int PyUnicode_Check(object obj)
cdef int PyString_Check(object obj)
Modified: lxml/trunk/src/lxml/serializer.pxi
==============================================================================
--- lxml/trunk/src/lxml/serializer.pxi (original)
+++ lxml/trunk/src/lxml/serializer.pxi Tue May 13 23:53:05 2008
@@ -400,9 +400,11 @@
cdef _dumpToFile(f, xmlNode* c_node, bint pretty_print, bint with_tail):
cdef tree.xmlOutputBuffer* c_buffer
- if not python.PyFile_Check(f):
+ cdef cstd.FILE* c_file
+ c_file = python.PyFile_AsFile(f)
+ if c_file is NULL:
raise ValueError, "not a file"
- c_buffer = tree.xmlOutputBufferCreateFile(python.PyFile_AsFile(f), NULL)
+ c_buffer = tree.xmlOutputBufferCreateFile(c_file, NULL)
tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0, pretty_print, NULL)
if with_tail:
_writeTail(c_buffer, c_node, NULL, 0)
More information about the lxml-checkins
mailing list