Skip to content

Commit a45f099

Browse files
committed
Fix python async load_markets
asyncio.create_task is only supported since python 3.7+
1 parent ba6446c commit a45f099

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

python/ccxt/async_support/base/exchange.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ async def load_markets(self, reload=False, params={}):
171171
self.reloading_markets = True
172172
coroutine = self.load_markets_helper(reload, params)
173173
# coroutines can only be awaited once so we wrap it in a task
174-
self.markets_loading = asyncio.create_task(coroutine)
174+
self.markets_loading = asyncio.ensure_future(coroutine)
175175
try:
176176
result = await self.markets_loading
177177
except Exception as e:

0 commit comments

Comments
 (0)