mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
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:
parent
452bf519a7
commit
be19ed77dd
331 changed files with 2567 additions and 2648 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue