Skip to content

Commit 7f9a2ae

Browse files
authored
Revert "bpo-34037, asyncio: add BaseEventLoop.wait_executor_on_close (GH-13786)" (#13802)
This reverts commit 0f0a30f.
1 parent 8f4bbb5 commit 7f9a2ae

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

Doc/library/asyncio-eventloop.rst

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,18 +140,12 @@ Running and stopping the loop
140140
The loop must not be running when this function is called.
141141
Any pending callbacks will be discarded.
142142

143-
This method clears all queues and shuts down the default executor. By
144-
default, it waits for the default executor to finish. Set
145-
*loop.wait_executor_on_close* to ``False`` to not wait for the executor.
143+
This method clears all queues and shuts down the executor, but does
144+
not wait for the executor to finish.
146145

147146
This method is idempotent and irreversible. No other methods
148147
should be called after the event loop is closed.
149148

150-
.. versionchanged:: 3.8
151-
The method now waits for the default executor to finish by default.
152-
Added *loop.wait_executor_on_close* attribute.
153-
154-
155149
.. coroutinemethod:: loop.shutdown_asyncgens()
156150

157151
Schedule all currently open :term:`asynchronous generator` objects to

Lib/asyncio/base_events.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,6 @@ async def wait_closed(self):
380380
class BaseEventLoop(events.AbstractEventLoop):
381381

382382
def __init__(self):
383-
# If true, close() waits for the default executor to finish
384-
self.wait_executor_on_close = True
385383
self._timer_cancelled_count = 0
386384
self._closed = False
387385
self._stopping = False
@@ -637,7 +635,7 @@ def close(self):
637635
executor = self._default_executor
638636
if executor is not None:
639637
self._default_executor = None
640-
executor.shutdown(wait=self.wait_executor_on_close)
638+
executor.shutdown(wait=False)
641639

642640
def is_closed(self):
643641
"""Returns True if the event loop was closed."""

Misc/NEWS.d/next/Library/2019-06-03-22-54-15.bpo-34037.fKNAbH.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)