Merge pull request #91 from soxoj/async-3.6.9-fix

Fix of 3.6.9 asyncio create_task error
This commit is contained in:
soxoj
2021-03-24 21:43:11 +03:00
committed by GitHub
2 changed files with 9 additions and 2 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.6.9, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
+8 -1
View File
@@ -119,7 +119,14 @@ class AsyncioProgressbarQueueExecutor(AsyncExecutor):
async def _run(self, tasks: QueriesDraft):
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)]
task_list = list(tasks)
self.progress = self.progress_func(total=len(task_list))