Fix of 3.6.9 asyncio create_task error

This commit is contained in:
Soxoj
2021-03-24 21:37:31 +03:00
parent 6da4ff1e7b
commit a044e3dd79
2 changed files with 9 additions and 2 deletions
+1 -1
View File
@@ -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
View File
@@ -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))