aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2021-03-17 09:56:53 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2021-03-23 00:07:14 +0200
commit13d3fbbf3e37404b2c5b46ca45e2306307104f26 (patch)
tree53c6baf12c278ec58ad7dce66e796a71699a5992
parent20a90cf709a399e639e6f092ab0bb06c087084dc (diff)
downloadmeson-13d3fbbf3e37404b2c5b46ca45e2306307104f26.zip
meson-13d3fbbf3e37404b2c5b46ca45e2306307104f26.tar.gz
meson-13d3fbbf3e37404b2c5b46ca45e2306307104f26.tar.bz2
mtest: remove pointless try/except from try_wait_one
asyncio.wait does not return an asyncio.TimeoutError, so there is no exception to catch.
-rw-r--r--mesonbuild/mtest.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py
index 42963ff..bef829a 100644
--- a/mesonbuild/mtest.py
+++ b/mesonbuild/mtest.py
@@ -1129,11 +1129,9 @@ def check_testdata(objs: T.List[TestSerialisation]) -> T.List[TestSerialisation]
# Custom waiting primitives for asyncio
async def try_wait_one(*awaitables: T.Any, timeout: T.Optional[T.Union[int, float]]) -> None:
- try:
- await asyncio.wait(awaitables,
- timeout=timeout, return_when=asyncio.FIRST_COMPLETED)
- except asyncio.TimeoutError:
- pass
+ """Wait for completion of one of the given futures, ignoring timeouts."""
+ await asyncio.wait(awaitables,
+ timeout=timeout, return_when=asyncio.FIRST_COMPLETED)
async def queue_iter(q: 'asyncio.Queue[T.Optional[str]]') -> T.AsyncIterator[str]:
while True: