[Lxml-checkins] r46227 - in lxml/trunk/src/lxml: . tests

scoder at codespeak.net scoder at codespeak.net
Fri Aug 31 21:32:28 CEST 2007


Author: scoder
Date: Fri Aug 31 21:32:27 2007
New Revision: 46227

Modified:
   lxml/trunk/src/lxml/objectify.pyx
   lxml/trunk/src/lxml/tests/test_objectify.py
Log:
fix namespace setup of objectify.E factory

Modified: lxml/trunk/src/lxml/objectify.pyx
==============================================================================
--- lxml/trunk/src/lxml/objectify.pyx	(original)
+++ lxml/trunk/src/lxml/objectify.pyx	Fri Aug 31 21:32:27 2007
@@ -1084,9 +1084,7 @@
         cdef int has_children
         cdef int has_string_value
         if self._element_factory is None:
-            element = cetree.makeElement(
-                self._tag, None, objectify_parser,
-                None, None, attrib, self._nsmap)
+            element = _makeElement(self._tag, None, attrib, self._nsmap)
         else:
             element = self._element_factory(self._tag, attrib, self._nsmap)
 
@@ -1917,13 +1915,13 @@
         parser = objectify_parser
     return _parse(f, parser)
 
-E = ElementMaker()
-
 cdef object _DEFAULT_NSMAP
 _DEFAULT_NSMAP = { "py"  : PYTYPE_NAMESPACE,
                    "xsi" : XML_SCHEMA_INSTANCE_NS,
                    "xsd" : XML_SCHEMA_NS}
 
+E = ElementMaker()
+
 def Element(_tag, attrib=None, nsmap=None, _pytype=None, **_attributes):
     """Objectify specific version of the lxml.etree Element() factory that
     always creates a structural (tree) element.

Modified: lxml/trunk/src/lxml/tests/test_objectify.py
==============================================================================
--- lxml/trunk/src/lxml/tests/test_objectify.py	(original)
+++ lxml/trunk/src/lxml/tests/test_objectify.py	Fri Aug 31 21:32:27 2007
@@ -1680,7 +1680,7 @@
     def test_efactory_long(self):
         E = objectify.E
         root = E.root(E.val(23L))
-        self.assert_(isinstance(root.val, objectify.IntElement))
+        self.assert_(isinstance(root.val, objectify.LongElement))
 
     def test_efactory_float(self):
         E = objectify.E


More information about the lxml-checkins mailing list