[Python-checkins] python/dist/src/Lib/xml/sax _exceptions.py, 1.9, 1.10

fdrake at users.sourceforge.net fdrake at users.sourceforge.net
Sat Mar 20 03:15:32 EST 2004


Update of /cvsroot/python/python/dist/src/Lib/xml/sax
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22325/xml/sax

Modified Files:
	_exceptions.py 
Log Message:
commit the portion of PyXML patch #919008 that is relevant to the
standard library:
str() of xml.sax.SAXParseException should not fail if the line and/or
column number returned by the locator are None
(tests added)


Index: _exceptions.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/xml/sax/_exceptions.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** _exceptions.py	22 Mar 2001 15:34:02 -0000	1.9
--- _exceptions.py	20 Mar 2004 08:15:30 -0000	1.10
***************
*** 92,97 ****
          if sysid is None:
              sysid = "<unknown>"
!         return "%s:%d:%d: %s" % (sysid, self.getLineNumber(),
!                                  self.getColumnNumber(), self._msg)
  
  
--- 92,102 ----
          if sysid is None:
              sysid = "<unknown>"
!         linenum = self.getLineNumber()
!         if linenum is None:
!            linenum = "?"
!         colnum = self.getColumnNumber()
!         if colnum is None:
!            colnum = "?"
!         return "%s:%s:%s: %s" % (sysid, linenum, colnum, self._msg)
  
  




More information about the Python-checkins mailing list