1.1 --- a/libxml2dom/macrolib/macrolib.py Sat Oct 06 23:48:45 2007 +0000
1.2 +++ b/libxml2dom/macrolib/macrolib.py Sun Oct 07 13:34:08 2007 +0000
1.3 @@ -548,6 +548,8 @@
1.4 # NOTE: Switching off validation and remote DTD resolution.
1.5 if not html:
1.6 context = libxml2mod.xmlCreateFileParserCtxt(s)
1.7 + if context is None:
1.8 + raise LSException(LSException.PARSE_ERR)
1.9 Parser_configure(context)
1.10 Parser_parse(context)
1.11 doc = Parser_document(context)
1.12 @@ -562,6 +564,8 @@
1.13 # NOTE: Switching off validation and remote DTD resolution.
1.14 if not html:
1.15 context = libxml2mod.xmlCreateMemoryParserCtxt(s, len(s))
1.16 + if context is None:
1.17 + raise LSException(LSException.PARSE_ERR)
1.18 Parser_configure(context)
1.19 Parser_parse(context)
1.20 doc = Parser_document(context)
1.21 @@ -579,6 +583,8 @@
1.22 # NOTE: Switching off validation and remote DTD resolution.
1.23 if not html:
1.24 context = libxml2mod.xmlCreateURLParserCtxt(uri, 0)
1.25 + if context is None:
1.26 + raise LSException(LSException.PARSE_ERR)
1.27 Parser_configure(context)
1.28 Parser_parse(context)
1.29 doc = Parser_document(context)