Skip to content
Snippets Groups Projects
Commit 12140572 authored by Sybren A. Stüvel's avatar Sybren A. Stüvel
Browse files

Mypy workaround, Windows-specific code fails mypy checks on Linux

parent fba56c40
No related branches found
No related tags found
No related merge requests found
...@@ -291,8 +291,9 @@ def construct_asyncio_loop() -> asyncio.AbstractEventLoop: ...@@ -291,8 +291,9 @@ def construct_asyncio_loop() -> asyncio.AbstractEventLoop:
# not support subprocesses. ProactorEventLoop should be used instead. # not support subprocesses. ProactorEventLoop should be used instead.
# Source: https://docs.python.org/3.5/library/asyncio-subprocess.html # Source: https://docs.python.org/3.5/library/asyncio-subprocess.html
if platform.system() == 'Windows': if platform.system() == 'Windows':
if not isinstance(loop, asyncio.ProactorEventLoop): # Silly MyPy doesn't understand this only runs on Windows.
loop = asyncio.ProactorEventLoop() if not isinstance(loop, asyncio.ProactorEventLoop): # type: ignore
loop = asyncio.ProactorEventLoop() # type: ignore
asyncio.set_event_loop(loop) asyncio.set_event_loop(loop)
return loop return loop
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment