[Lxml-checkins] r41985 - lxml/trunk/src/lxml

scoder at codespeak.net scoder at codespeak.net
Tue Apr 10 13:30:34 CEST 2007


Author: scoder
Date: Tue Apr 10 13:30:33 2007
New Revision: 41985

Modified:
   lxml/trunk/src/lxml/xslt.pxi
Log:
exception message cleanup

Modified: lxml/trunk/src/lxml/xslt.pxi
==============================================================================
--- lxml/trunk/src/lxml/xslt.pxi	(original)
+++ lxml/trunk/src/lxml/xslt.pxi	Tue Apr 10 13:30:33 2007
@@ -296,7 +296,7 @@
             if self._error_log.last_error is not None:
                 raise XSLTParseError, self._error_log.last_error.message
             else:
-                raise XSLTParseError, "Cannot parse style sheet"
+                raise XSLTParseError, "Cannot parse stylesheet"
 
         c_doc._private = NULL # no longer used!
         self._c_style = c_style
@@ -344,7 +344,7 @@
         transform_ctxt = xslt.xsltNewTransformContext(self._c_style, c_doc)
         if transform_ctxt is NULL:
             _destroyFakeDoc(input_doc._c_doc, c_doc)
-            raise XSLTApplyError, "Error preparing stylesheet run"
+            python.PyErr_NoMemory()
 
         initTransformDict(transform_ctxt)
 
@@ -383,7 +383,7 @@
                         message = "%s, line %d" % (error.message, error.line)
                     else:
                         message = error.message
-                elif error.line >= 0:
+                elif error is not None and error.line >= 0:
                     message = "Error applying stylesheet, line %d" % error.line
                 else:
                     message = "Error applying stylesheet"


More information about the lxml-checkins mailing list