
stoopid question: why the heck is xmllib using "RuntimeError" to flag XML syntax errors? raise RuntimeError, 'Syntax error at line %d: %s' % (self.lineno, message) what's wrong with "SyntaxError"? </F>

[/F]
stoopid question: why the heck is xmllib using "RuntimeError" to flag XML syntax errors?
Because it's too cheap to declare its own exception?
raise RuntimeError, 'Syntax error at line %d: %s' % (self.lineno, message)
what's wrong with "SyntaxError"?
That would be the wrong exception unless it's parsing Python source code. --Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)

Fredrik Lundh writes:
Looks like someone already added Error for this.
And this still isn't done. I've made changes in my working copy, introducting a specific exception which carries useful information (msg, filename, lineno), so that all syntax exceptions get this information as well. -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> PythonLabs at Digital Creations
participants (3)
-
Fred L. Drake, Jr.
-
Fredrik Lundh
-
Guido van Rossum