mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +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
|
@ -17,20 +17,20 @@ class TestThread(_threading.Thread):
|
|||
#delay = random.random() * 2
|
||||
delay = 0
|
||||
if verbose:
|
||||
print 'task', self.getName(), 'will run for', delay, 'sec'
|
||||
print('task', self.getName(), 'will run for', delay, 'sec')
|
||||
sema.acquire()
|
||||
mutex.acquire()
|
||||
running = running + 1
|
||||
if verbose:
|
||||
print running, 'tasks are running'
|
||||
print(running, 'tasks are running')
|
||||
mutex.release()
|
||||
time.sleep(delay)
|
||||
if verbose:
|
||||
print 'task', self.getName(), 'done'
|
||||
print('task', self.getName(), 'done')
|
||||
mutex.acquire()
|
||||
running = running - 1
|
||||
if verbose:
|
||||
print self.getName(), 'is finished.', running, 'tasks are running'
|
||||
print(self.getName(), 'is finished.', running, 'tasks are running')
|
||||
mutex.release()
|
||||
sema.release()
|
||||
|
||||
|
@ -61,11 +61,11 @@ def test_main():
|
|||
starttasks()
|
||||
|
||||
if verbose:
|
||||
print 'waiting for all tasks to complete'
|
||||
print('waiting for all tasks to complete')
|
||||
for t in threads:
|
||||
t.join()
|
||||
if verbose:
|
||||
print 'all tasks done'
|
||||
print('all tasks done')
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue