diff options
author | Guido van Rossum <guido@python.org> | 2007-02-09 05:37:30 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-02-09 05:37:30 (GMT) |
commit | be19ed77ddb047e02fe94d142181062af6d99dcc (patch) | |
tree | 70f214e06554046fcccbadeb78665f25e07ce965 /Lib/sgmllib.py | |
parent | 452bf519a70c3db0e7f0d2540b1bfb07d9085583 (diff) | |
download | cpython-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/sgmllib.py')
-rw-r--r-- | Lib/sgmllib.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Lib/sgmllib.py b/Lib/sgmllib.py index 1574f44..987b65ed 100644 --- a/Lib/sgmllib.py +++ b/Lib/sgmllib.py @@ -382,8 +382,8 @@ class SGMLParser(markupbase.ParserBase): # Example -- report an unbalanced </...> tag. def report_unbalanced(self, tag): if self.verbose: - print '*** Unbalanced </' + tag + '>' - print '*** Stack:', self.stack + print('*** Unbalanced </' + tag + '>') + print('*** Stack:', self.stack) def convert_charref(self, name): """Convert character reference, may be overridden.""" @@ -468,40 +468,40 @@ class TestSGMLParser(SGMLParser): data = self.testdata if data: self.testdata = "" - print 'data:', repr(data) + print('data:', 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 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: - 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 unknown_decl(self, data): self.flush() - print '*** unknown decl: [' + data + ']' + print('*** unknown decl: [' + data + ']') def close(self): SGMLParser.close(self) @@ -531,7 +531,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() |