From fb90bdd12c0bb477adb0e2ebe52c598776d026da Mon Sep 17 00:00:00 2001 From: Phil Salant Date: Mon, 31 Oct 2022 16:56:57 -0600 Subject: [PATCH] Remove `__set_event_loop()` Per the Python documentation, `asyncio.ProactorEventLoop` is used by default on Windows as of Python 3.8. Python 3.8 is the minimum supported version for this repository. --- fideslog/sdk/python/client.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/fideslog/sdk/python/client.py b/fideslog/sdk/python/client.py index e9723cd..e1cfd54 100644 --- a/fideslog/sdk/python/client.py +++ b/fideslog/sdk/python/client.py @@ -1,7 +1,6 @@ # pylint: disable=import-outside-toplevel, too-many-arguments from asyncio import run -from sys import platform, version_info from typing import Dict, Optional, Union from aiohttp import ( @@ -24,25 +23,6 @@ REQUIRED_HEADERS = {"X-Fideslog-Version": __version__} -def __set_event_loop() -> None: - """ - Helps to work around a bug in the default Windows event loop for Python 3.8+ - by changing the default event loop in Windows processes. - """ - - if ( - version_info[0] == 3 - and version_info[1] >= 8 - and platform.lower().startswith("win") - ): - from asyncio import ( # type: ignore[attr-defined] - WindowsSelectorEventLoopPolicy, - set_event_loop_policy, - ) - - set_event_loop_policy(WindowsSelectorEventLoopPolicy()) - - class AnalyticsClient: """ An instance of a fides tool that wishes to send @@ -91,7 +71,6 @@ def register(self, registration: Registration) -> None: Register a new user. """ - __set_event_loop() run(self.send_async(registration)) async def register_async(self, registration: Registration) -> None: @@ -106,7 +85,6 @@ def send(self, event: AnalyticsEvent) -> None: Record a new analytics event. """ - __set_event_loop() run(self.send_async(event)) async def send_async(