Skip to content

Commit ffa9ec9

Browse files
do the same for python tasks
1 parent 37f8e99 commit ffa9ec9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Lib/asyncio/futures.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ def __init__(self, *, loop=None):
7979
loop object used by the future. If it's not provided, the future uses
8080
the default event loop.
8181
"""
82+
if self._loop is not None:
83+
raise RuntimeError(f'{self.__class__.__name__} object is already '
84+
'initialized.')
85+
8286
if loop is None:
8387
self._loop = events.get_event_loop()
8488
else:

0 commit comments

Comments
 (0)