From a1169ca3c3597b26dc408e97ec537547b9143d28 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Fri, 3 Apr 2020 12:23:00 +0200 Subject: [PATCH] fix compatibility with Python 3.8 on Windows --- mitmproxy/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mitmproxy/__init__.py b/mitmproxy/__init__.py index e69de29bb..e930cf1e4 100644 --- a/mitmproxy/__init__.py +++ b/mitmproxy/__init__.py @@ -0,0 +1,8 @@ +import asyncio +import sys + +if sys.platform == 'win32': + # workaround for + # https://github.com/tornadoweb/tornado/issues/2751 + # https://www.tornadoweb.org/en/stable/index.html#installation + asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())