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.)
diff --git a/Lib/calendar.py b/Lib/calendar.py
index 00948ef..149c7ad 100644
--- a/Lib/calendar.py
+++ b/Lib/calendar.py
@@ -261,7 +261,7 @@
"""
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 @@
"""
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 @@
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 @@
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 @@
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 @@
sys.exit(1)
if options.encoding:
result = result.encode(options.encoding)
- print result
+ print(result)
if __name__ == "__main__":