mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 21:21:15 -03:00
Attempt to fix Opensuse Leap 15.6 nightlies
This has been failing because it uses Python 3.6. Until we have figured out when we can roll platform off (#11679), let's try to fix this. Untested.
This commit is contained in:
@@ -193,7 +193,7 @@ async def main():
|
||||
|
||||
semaphore = asyncio.Semaphore(max_concurrency) if max_concurrency else None
|
||||
|
||||
async def run(f, arg):
|
||||
async def run(f, arg) -> TestResult:
|
||||
# TODO(python>3.8): use "async with"
|
||||
if semaphore is not None:
|
||||
await semaphore.acquire()
|
||||
@@ -205,7 +205,7 @@ async def main():
|
||||
if semaphore is not None:
|
||||
semaphore.release()
|
||||
|
||||
tasks = [asyncio.create_task(run(f, arg), name=arg) for f, arg in files]
|
||||
tasks = [create_task(run(f, arg), name=arg) for f, arg in files]
|
||||
while tasks:
|
||||
done, tasks = await asyncio.wait(tasks, return_when=asyncio.FIRST_COMPLETED)
|
||||
for task in done:
|
||||
@@ -276,6 +276,14 @@ class TestPass:
|
||||
TestResult = Union[TestSkip, TestFail, TestPass]
|
||||
|
||||
|
||||
# TODO(python>3.8): use asyncio.create_task
|
||||
def create_task(coro, name: str) -> asyncio.Task:
|
||||
task = asyncio.Task(coro)
|
||||
if sys.version_info >= (3, 8):
|
||||
task.set_name(name)
|
||||
return task
|
||||
|
||||
|
||||
async def run_test(
|
||||
tmp_root: Path,
|
||||
test_file_path: str,
|
||||
|
||||
Reference in New Issue
Block a user