From 04f4943d132d0d5e9829923706a2cb07a2b0ae9f Mon Sep 17 00:00:00 2001 From: "Martin v. Löwis" Date: Mon, 9 Oct 2000 16:45:54 +0000 Subject: _exceptions: Format a missing system id as . expatreader: Use the error handler instead of raising exception directly. --- Lib/xml/sax/_exceptions.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Lib/xml/sax/_exceptions.py') diff --git a/Lib/xml/sax/_exceptions.py b/Lib/xml/sax/_exceptions.py index 1804f3fde22..88ec8ca5983 100644 --- a/Lib/xml/sax/_exceptions.py +++ b/Lib/xml/sax/_exceptions.py @@ -79,10 +79,11 @@ class SAXParseException(SAXException): def __str__(self): "Create a string representation of the exception." - return "%s at %s:%d:%d" % (self._msg, - self.getSystemId(), - self.getLineNumber(), - self.getColumnNumber()) + sysid = self.getSystemId() + if sysid is None: + sysid = "" + return "%s:%d:%d: %s" % (sysid, self.getLineNumber(), + self.getColumnNumber(), self._msg) # ===== SAXNOTRECOGNIZEDEXCEPTION ===== -- cgit v1.2.3