summaryrefslogtreecommitdiffstats
path: root/Lib/xml/sax/_exceptions.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/xml/sax/_exceptions.py')
-rw-r--r--Lib/xml/sax/_exceptions.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/xml/sax/_exceptions.py b/Lib/xml/sax/_exceptions.py
index 1804f3f..88ec8ca 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 = "<unknown>"
+ return "%s:%d:%d: %s" % (sysid, self.getLineNumber(),
+ self.getColumnNumber(), self._msg)
# ===== SAXNOTRECOGNIZEDEXCEPTION =====