summaryrefslogtreecommitdiffstats
path: root/Lib/xmllib.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-02-09 05:37:30 (GMT)
committerGuido van Rossum <guido@python.org>2007-02-09 05:37:30 (GMT)
commitbe19ed77ddb047e02fe94d142181062af6d99dcc (patch)
tree70f214e06554046fcccbadeb78665f25e07ce965 /Lib/xmllib.py
parent452bf519a70c3db0e7f0d2540b1bfb07d9085583 (diff)
downloadcpython-be19ed77ddb047e02fe94d142181062af6d99dcc.zip
cpython-be19ed77ddb047e02fe94d142181062af6d99dcc.tar.gz
cpython-be19ed77ddb047e02fe94d142181062af6d99dcc.tar.bz2
Fix most trivially-findable print statements.
There's one major and one minor category still unfixed: doctests are the major category (and I hope to be able to augment the refactoring tool to refactor bona fide doctests soon); other code generating print statements in strings is the minor category. (Oh, and I don't know if the compiler package works.)
Diffstat (limited to 'Lib/xmllib.py')
-rw-r--r--Lib/xmllib.py36
1 files changed, 18 insertions, 18 deletions
diff --git a/Lib/xmllib.py b/Lib/xmllib.py
index 59fbcd1..6663a23 100644
--- a/Lib/xmllib.py
+++ b/Lib/xmllib.py
@@ -809,11 +809,11 @@ class TestXMLParser(XMLParser):
def handle_xml(self, encoding, standalone):
self.flush()
- print 'xml: encoding =',encoding,'standalone =',standalone
+ print('xml: encoding =',encoding,'standalone =',standalone)
def handle_doctype(self, tag, pubid, syslit, data):
self.flush()
- print 'DOCTYPE:',tag, repr(data)
+ print('DOCTYPE:',tag, repr(data))
def handle_data(self, data):
self.testdata = self.testdata + data
@@ -824,47 +824,47 @@ class TestXMLParser(XMLParser):
data = self.testdata
if data:
self.testdata = ""
- print 'data:', repr(data)
+ print('data:', repr(data))
def handle_cdata(self, data):
self.flush()
- print 'cdata:', repr(data)
+ print('cdata:', repr(data))
def handle_proc(self, name, data):
self.flush()
- print 'processing:',name,repr(data)
+ print('processing:',name,repr(data))
def handle_comment(self, data):
self.flush()
r = repr(data)
if len(r) > 68:
r = r[:32] + '...' + r[-32:]
- print 'comment:', r
+ print('comment:', r)
def syntax_error(self, message):
- print 'error at line %d:' % self.lineno, message
+ print('error at line %d:' % self.lineno, message)
def unknown_starttag(self, tag, attrs):
self.flush()
if not attrs:
- print 'start tag: <' + tag + '>'
+ print('start tag: <' + tag + '>')
else:
- print 'start tag: <' + tag,
+ print('start tag: <' + tag, end=' ')
for name, value in attrs.items():
- print name + '=' + '"' + value + '"',
- print '>'
+ print(name + '=' + '"' + value + '"', end=' ')
+ print('>')
def unknown_endtag(self, tag):
self.flush()
- print 'end tag: </' + tag + '>'
+ print('end tag: </' + tag + '>')
def unknown_entityref(self, ref):
self.flush()
- print '*** unknown entity ref: &' + ref + ';'
+ print('*** unknown entity ref: &' + ref + ';')
def unknown_charref(self, ref):
self.flush()
- print '*** unknown char ref: &#' + ref + ';'
+ print('*** unknown char ref: &#' + ref + ';')
def close(self):
XMLParser.close(self)
@@ -897,7 +897,7 @@ def test(args = None):
try:
f = open(file, 'r')
except IOError as msg:
- print file, ":", msg
+ print(file, ":", msg)
sys.exit(1)
data = f.read()
@@ -916,13 +916,13 @@ def test(args = None):
x.close()
except Error as msg:
t1 = time()
- print msg
+ print(msg)
if do_time:
- print 'total time: %g' % (t1-t0)
+ print('total time: %g' % (t1-t0))
sys.exit(1)
t1 = time()
if do_time:
- print 'total time: %g' % (t1-t0)
+ print('total time: %g' % (t1-t0))
if __name__ == '__main__':