Skip to content

Commit

Permalink
set loop to None in Python 3.10 (#348)
Browse files Browse the repository at this point in the history
* set loop to None in Python 3.10

* do not pass loop at all in Python 3.10
  • Loading branch information
basnijholt committed May 31, 2022
1 parent a596bcd commit 59edcd7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions adaptive/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import itertools
import pickle
import platform
import sys
import time
import traceback
import warnings
Expand Down Expand Up @@ -640,9 +641,8 @@ async def _run(self):
try:
while not self.goal(self.learner):
futures = self._get_futures()
done, _ = await asyncio.wait(
futures, return_when=first_completed, loop=self.ioloop
)
kw = {"loop": self.ioloop} if sys.version_info[:2] < (3, 10) else {}
done, _ = await asyncio.wait(futures, return_when=first_completed, **kw)
self._process_futures(done)
finally:
remaining = self._remove_unfinished()
Expand Down

0 comments on commit 59edcd7

Please sign in to comment.