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/test/test_pyclbr.py b/Lib/test/test_pyclbr.py
index a03daa9..478083e 100644
--- a/Lib/test/test_pyclbr.py
+++ b/Lib/test/test_pyclbr.py
@@ -28,13 +28,13 @@
''' succeed iff {l1} - {ignore} == {l2} - {ignore} '''
missing = (set(l1) ^ set(l2)) - set(ignore)
if missing:
- print >>sys.stderr, "l1=%r\nl2=%r\nignore=%r" % (l1, l2, ignore)
+ print("l1=%r\nl2=%r\nignore=%r" % (l1, l2, ignore), file=sys.stderr)
self.fail("%r missing" % missing.pop())
def assertHasattr(self, obj, attr, ignore):
''' succeed iff hasattr(obj,attr) or attr in ignore. '''
if attr in ignore: return
- if not hasattr(obj, attr): print "???", attr
+ if not hasattr(obj, attr): print("???", attr)
self.failUnless(hasattr(obj, attr),
'expected hasattr(%r, %r)' % (obj, attr))
@@ -43,7 +43,7 @@
''' succeed iff key in obj or key in ignore. '''
if key in ignore: return
if key not in obj:
- print >>sys.stderr, "***",key
+ print("***",key, file=sys.stderr)
self.failUnless(key in obj)
def assertEqualsOrIgnored(self, a, b, ignore):
@@ -110,7 +110,7 @@
try:
self.assertListEq(real_bases, pyclbr_bases, ignore)
except:
- print >>sys.stderr, "class=%s" % py_item
+ print("class=%s" % py_item, file=sys.stderr)
raise
actualMethods = []
@@ -132,7 +132,7 @@
ignore)
# can't check file or lineno
except:
- print >>sys.stderr, "class=%s" % py_item
+ print("class=%s" % py_item, file=sys.stderr)
raise
# Now check for missing stuff.