summaryrefslogtreecommitdiff
path: root/src/lxml/docloader.pxi
diff options
context:
space:
mode:
authorscoder <none@none>2010-04-27 21:41:38 +0200
committerscoder <none@none>2010-04-27 21:41:38 +0200
commit8f4837cb2168960ff72ec4083b32495b9f2f72eb (patch)
treeb58ff387127e786777ab16427c29a729d951d9fa /src/lxml/docloader.pxi
parent376c9b769fff199cb49d6a826dc995256838e9da (diff)
downloadpython-lxml-8f4837cb2168960ff72ec4083b32495b9f2f72eb.tar.gz
[svn r4402] r5569@lenny: sbehnel | 2010-04-27 21:41:20 +0200
API hardening against uninitialised proxies and missing __init__ calls --HG-- branch : trunk
Diffstat (limited to 'src/lxml/docloader.pxi')
-rw-r--r--src/lxml/docloader.pxi7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lxml/docloader.pxi b/src/lxml/docloader.pxi
index dd95e1e8..42409a53 100644
--- a/src/lxml/docloader.pxi
+++ b/src/lxml/docloader.pxi
@@ -1,6 +1,7 @@
# Custom resolver API
ctypedef enum _InputDocumentDataType:
+ PARSER_DATA_INVALID
PARSER_DATA_EMPTY
PARSER_DATA_STRING
PARSER_DATA_FILENAME
@@ -12,6 +13,10 @@ cdef class _InputDocument:
cdef object _filename
cdef object _file
+ def __cinit__(self):
+ self._type = PARSER_DATA_INVALID
+
+
cdef class Resolver:
u"This is the base class of all resolvers."
def resolve(self, system_url, public_id, context):
@@ -101,7 +106,7 @@ cdef class Resolver:
cdef class _ResolverRegistry:
cdef object _resolvers
cdef Resolver _default_resolver
- def __init__(self, Resolver default_resolver=None):
+ def __cinit__(self, Resolver default_resolver=None):
self._resolvers = set()
self._default_resolver = default_resolver