Skip to content

Commit 59edcd7

Browse files
authored
set loop to None in Python 3.10 (#348)
* set loop to None in Python 3.10 * do not pass loop at all in Python 3.10
1 parent a596bcd commit 59edcd7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

adaptive/runner.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import itertools
77
import pickle
88
import platform
9+
import sys
910
import time
1011
import traceback
1112
import warnings
@@ -640,9 +641,8 @@ async def _run(self):
640641
try:
641642
while not self.goal(self.learner):
642643
futures = self._get_futures()
643-
done, _ = await asyncio.wait(
644-
futures, return_when=first_completed, loop=self.ioloop
645-
)
644+
kw = {"loop": self.ioloop} if sys.version_info[:2] < (3, 10) else {}
645+
done, _ = await asyncio.wait(futures, return_when=first_completed, **kw)
646646
self._process_futures(done)
647647
finally:
648648
remaining = self._remove_unfinished()

0 commit comments

Comments
 (0)