Browse files

use absolute cimports to prevent build interference with already inst…

…alled lxml packages
  • Loading branch information...
scoder committed Jul 30, 2012
1 parent 327cdbc commit 5658b26a7c7d9baf7b072a1de888e39d7b531eff
@@ -1,6 +1,6 @@
# Private/public helper functions for API functions
-cimport uri
+from lxml.includes cimport uri
cdef void displayNode(xmlNode* c_node, indent):
# to help with debugging
@@ -1,5 +1,5 @@
# support for DTD validation
-cimport dtdvalid
+from lxml.includes cimport dtdvalid
class DTDError(LxmlError):
u"""Base class for DTD errors.
@@ -39,11 +39,12 @@ __all__ = [
cimport cython
-cimport tree, python, config
-from tree cimport xmlDoc, xmlNode, xmlAttr, xmlNs, _isElement, _getNs
-from python cimport callable, _cstr, _isString
-cimport xpath
-cimport c14n
+from lxml cimport python
+from lxml.includes cimport tree, config
+from lxml.includes.tree cimport xmlDoc, xmlNode, xmlAttr, xmlNs, _isElement, _getNs
+from lxml.python cimport callable, _cstr, _isString
+from lxml.includes cimport xpath
+from lxml.includes cimport c14n
# Cython's standard declarations
cimport cpython.mem
@@ -76,7 +77,7 @@ except (ImportError, AttributeError):
from StringIO import StringIO, StringIO as BytesIO
cdef object _elementpath
-import _elementpath
+from lxml import _elementpath
cdef object sys
import sys
@@ -2,12 +2,12 @@ u"""The ``lxml.objectify`` module implements a Python object API for
XML. It is based on `lxml.etree`.
-from etreepublic cimport _Document, _Element, ElementBase, ElementClassLookup
-from etreepublic cimport elementFactory, import_lxml__etree, textOf, pyunicode
-from python cimport callable, _cstr
-cimport etreepublic as cetree
-cimport python
-cimport tree
+from lxml.includes.etreepublic cimport _Document, _Element, ElementBase, ElementClassLookup
+from lxml.includes.etreepublic cimport elementFactory, import_lxml__etree, textOf, pyunicode
+from lxml.python cimport callable, _cstr
+cimport lxml.includes.etreepublic as cetree
+from lxml cimport python
+from lxml.includes cimport tree
cimport libc.string as cstring_h # not to be confused with stdlib 'string'
__all__ = [u'BoolElement', u'DataElement', u'E', u'Element', u'ElementMaker',
@@ -1,7 +1,7 @@
# Parsers for XML and HTML
-cimport xmlparser
-cimport htmlparser
+from lxml.includes cimport xmlparser
+from lxml.includes cimport htmlparser
cdef class _ParserContext(_ResolverContext)
cdef class _SaxParserContext(_ParserContext)
@@ -1,5 +1,5 @@
# support for RelaxNG validation
-cimport relaxng
+from lxml.includes cimport relaxng
class RelaxNGError(LxmlError):
u"""Base class for RelaxNG errors.
@@ -1,5 +1,5 @@
# support for Schematron validation
-cimport schematron
+from lxml.includes cimport schematron
class SchematronError(LxmlError):
u"""Base class of all Schematron errors.
@@ -1,6 +1,6 @@
# XInclude processing
-cimport xinclude
+from lxml.includes cimport xinclude
class XIncludeError(LxmlError):
u"""Error during XInclude processing.
@@ -1,7 +1,7 @@
# DEBUG and error logging
-cimport xmlerror
-cimport cvarargs
+from lxml.includes cimport xmlerror
+from lxml cimport cvarargs
# module level API functions
@@ -1,5 +1,5 @@
# support for XMLSchema validation
-cimport xmlschema
+from lxml.includes cimport xmlschema
class XMLSchemaError(LxmlError):
u"""Base class of all XML Schema errors
@@ -1,6 +1,6 @@
-cimport xslt
+from lxml.includes cimport xslt
class XSLTError(LxmlError):
u"""Base class of all XSLT errors.

0 comments on commit 5658b26

Please sign in to comment.