diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-04-12 17:48:46 +0200 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-04-12 17:48:46 +0200 |
commit | 27be5da8310931bfb3c02769f91e67429b08c545 (patch) | |
tree | a7b3743d5f995c82218f40eb4fdbe5c8867db894 /Lib/concurrent/futures/thread.py | |
parent | 35af9536ad914c1b4f8ac2262c055425eec8d34e (diff) | |
download | cpython-27be5da8310931bfb3c02769f91e67429b08c545.tar.gz cpython-27be5da8310931bfb3c02769f91e67429b08c545.zip |
Issue #11815: Remove dead code in concurrent.futures (since a blocking Queue
cannot raise queue.Empty).
Diffstat (limited to 'Lib/concurrent/futures/thread.py')
-rw-r--r-- | Lib/concurrent/futures/thread.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Lib/concurrent/futures/thread.py b/Lib/concurrent/futures/thread.py index 93b495f55a3..fbac0887a59 100644 --- a/Lib/concurrent/futures/thread.py +++ b/Lib/concurrent/futures/thread.py @@ -60,14 +60,10 @@ class _WorkItem(object): def _worker(executor_reference, work_queue): try: while True: - try: - work_item = work_queue.get(block=True) - except queue.Empty: - pass - else: - if work_item is not None: - work_item.run() - continue + work_item = work_queue.get(block=True) + if work_item is not None: + work_item.run() + continue executor = executor_reference() # Exit if: # - The interpreter is shutting down OR |