Skip to content

Commit 3386f87

Browse files
Remove print race from task_done example. (GH-31795)
(cherry picked from commit a0eb69c) Co-authored-by: Raymond Hettinger <[email protected]>
1 parent 5dfe981 commit 3386f87

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Doc/library/queue.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,15 +201,14 @@ Example of how to wait for enqueued tasks to be completed::
201201
print(f'Finished {item}')
202202
q.task_done()
203203

204-
# turn-on the worker thread
204+
# Turn-on the worker thread.
205205
threading.Thread(target=worker, daemon=True).start()
206206

207-
# send thirty task requests to the worker
207+
# Send thirty task requests to the worker.
208208
for item in range(30):
209209
q.put(item)
210-
print('All task requests sent\n', end='')
211210

212-
# block until all tasks are done
211+
# Block until all tasks are done.
213212
q.join()
214213
print('All work completed')
215214

0 commit comments

Comments
 (0)