diff options
author | scoder <none@none> | 2010-04-27 21:41:38 +0200 |
---|---|---|
committer | scoder <none@none> | 2010-04-27 21:41:38 +0200 |
commit | 8f4837cb2168960ff72ec4083b32495b9f2f72eb (patch) | |
tree | b58ff387127e786777ab16427c29a729d951d9fa /src/lxml/docloader.pxi | |
parent | 376c9b769fff199cb49d6a826dc995256838e9da (diff) | |
download | python-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.pxi | 7 |
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 |