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.)
This commit is contained in:
Guido van Rossum 2007-02-09 05:37:30 +00:00
parent 452bf519a7
commit be19ed77dd
331 changed files with 2567 additions and 2648 deletions

View file

@ -261,7 +261,7 @@ class TextCalendar(Calendar):
"""
Print a single week (no newline).
"""
print self.week(theweek, width),
print(self.week(theweek, width), end=' ')
def formatday(self, day, weekday, width):
"""
@ -308,7 +308,7 @@ class TextCalendar(Calendar):
"""
Print a month's calendar.
"""
print self.formatmonth(theyear, themonth, w, l),
print(self.formatmonth(theyear, themonth, w, l), end=' ')
def formatmonth(self, theyear, themonth, w=0, l=0):
"""
@ -365,7 +365,7 @@ class TextCalendar(Calendar):
def pryear(self, theyear, w=0, l=0, c=6, m=3):
"""Print a year's calendar."""
print self.formatyear(theyear, w, l, c, m)
print(self.formatyear(theyear, w, l, c, m))
class HTMLCalendar(Calendar):
@ -584,7 +584,7 @@ _spacing = 6 # Number of spaces between columns
def format(cols, colwidth=_colwidth, spacing=_spacing):
"""Prints multi-column formatting for year calendars"""
print formatstring(cols, colwidth, spacing)
print(formatstring(cols, colwidth, spacing))
def formatstring(cols, colwidth=_colwidth, spacing=_spacing):
@ -668,9 +668,9 @@ def main(args):
encoding = sys.getdefaultencoding()
optdict = dict(encoding=encoding, css=options.css)
if len(args) == 1:
print cal.formatyearpage(datetime.date.today().year, **optdict)
print(cal.formatyearpage(datetime.date.today().year, **optdict))
elif len(args) == 2:
print cal.formatyearpage(int(args[1]), **optdict)
print(cal.formatyearpage(int(args[1]), **optdict))
else:
parser.error("incorrect number of arguments")
sys.exit(1)
@ -694,7 +694,7 @@ def main(args):
sys.exit(1)
if options.encoding:
result = result.encode(options.encoding)
print result
print(result)
if __name__ == "__main__":