From 121405724ce1e970df3f60630234ea831fe37d21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= <sybren@stuvel.eu> Date: Thu, 10 Jan 2019 16:44:27 +0100 Subject: [PATCH] Mypy workaround, Windows-specific code fails mypy checks on Linux --- flamenco_worker/cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flamenco_worker/cli.py b/flamenco_worker/cli.py index 3d3cceaf..80055856 100644 --- a/flamenco_worker/cli.py +++ b/flamenco_worker/cli.py @@ -291,8 +291,9 @@ def construct_asyncio_loop() -> asyncio.AbstractEventLoop: # not support subprocesses. ProactorEventLoop should be used instead. # Source: https://docs.python.org/3.5/library/asyncio-subprocess.html if platform.system() == 'Windows': - if not isinstance(loop, asyncio.ProactorEventLoop): - loop = asyncio.ProactorEventLoop() + # Silly MyPy doesn't understand this only runs on Windows. + if not isinstance(loop, asyncio.ProactorEventLoop): # type: ignore + loop = asyncio.ProactorEventLoop() # type: ignore asyncio.set_event_loop(loop) return loop -- GitLab