mirror of
https://github.com/soxoj/maigret.git
synced 2026-05-07 06:24:35 +00:00
Fix of 3.6.9 asyncio create_task error
This commit is contained in:
@@ -15,7 +15,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version: [3.6, 3.7, 3.8, 3.9]
|
python-version: [3.6.9, 3.7, 3.8, 3.9]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|||||||
+8
-1
@@ -119,7 +119,14 @@ class AsyncioProgressbarQueueExecutor(AsyncExecutor):
|
|||||||
|
|
||||||
async def _run(self, tasks: QueriesDraft):
|
async def _run(self, tasks: QueriesDraft):
|
||||||
self.results = []
|
self.results = []
|
||||||
workers = [asyncio.create_task(self.worker())
|
|
||||||
|
if sys.version_info.minor > 6:
|
||||||
|
create_task = asyncio.create_task
|
||||||
|
else:
|
||||||
|
loop = asyncio.get_event_loop()
|
||||||
|
create_task = loop.create_task
|
||||||
|
|
||||||
|
workers = [create_task(self.worker())
|
||||||
for _ in range(self.workers_count)]
|
for _ in range(self.workers_count)]
|
||||||
task_list = list(tasks)
|
task_list = list(tasks)
|
||||||
self.progress = self.progress_func(total=len(task_list))
|
self.progress = self.progress_func(total=len(task_list))
|
||||||
|
|||||||
Reference in New Issue
Block a user