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

@ -28,13 +28,13 @@ class PyclbrTest(TestCase):
''' 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 @@ class PyclbrTest(TestCase):
''' 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 @@ class PyclbrTest(TestCase):
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 @@ class PyclbrTest(TestCase):
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.