[pypy-svn] r79021 - pypy/branch/fast-forward/pypy/module/pyexpat
afa at codespeak.net
afa at codespeak.net
Fri Nov 12 00:18:29 CET 2010
Author: afa
Date: Fri Nov 12 00:18:28 2010
New Revision: 79021
Modified:
pypy/branch/fast-forward/pypy/module/pyexpat/interp_pyexpat.py
Log:
Handle errors a bit sooner
Modified: pypy/branch/fast-forward/pypy/module/pyexpat/interp_pyexpat.py
==============================================================================
--- pypy/branch/fast-forward/pypy/module/pyexpat/interp_pyexpat.py (original)
+++ pypy/branch/fast-forward/pypy/module/pyexpat/interp_pyexpat.py Fri Nov 12 00:18:28 2010
@@ -492,6 +492,9 @@
xmlparser = XML_ExternalEntityParserCreate(
self.itself, context, encoding)
+ if not xmlparser:
+ raise MemoryError
+
parser = W_XMLParserType(space, xmlparser, self.w_intern)
# copy handlers from self
@@ -657,11 +660,11 @@
else:
xmlparser = XML_ParserCreate(encoding)
- parser = W_XMLParserType(space, xmlparser, w_intern)
- if not parser.itself:
+ if not xmlparser:
raise OperationError(space.w_RuntimeError,
space.wrap('XML_ParserCreate failed'))
+ parser = W_XMLParserType(space, xmlparser, w_intern)
return space.wrap(parser)
ParserCreate.unwrap_spec = [ObjSpace, W_Root, W_Root, W_Root]
More information about the Pypy-commit
mailing list