Skip to content

Commit 30e1a4a

Browse files
author
Guido van Rossum
committed
Wrap ProactorEventLoop import in platform check.
1 parent d0f7a5e commit 30e1a4a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test-data/samples/crawl2.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -825,9 +825,12 @@ def main() -> None:
825825
log = Logger(args.level)
826826

827827
if args.iocp:
828-
from asyncio import ProactorEventLoop
829-
loop = ProactorEventLoop() # type: ignore
830-
asyncio.set_event_loop(loop)
828+
if sys.platform == 'win32':
829+
from asyncio import ProactorEventLoop
830+
loop = ProactorEventLoop() # type: ignore
831+
asyncio.set_event_loop(loop)
832+
else:
833+
assert False
831834
elif args.select:
832835
loop = asyncio.SelectorEventLoop() # type: ignore
833836
asyncio.set_event_loop(loop)

0 commit comments

Comments
 (0)