Skip to content

Commit

Permalink
Merge pull request #95 from ethyca/restore-set-event-loop
Browse files Browse the repository at this point in the history
Remove `__set_event_loop()`
  • Loading branch information
PSalant726 authored Oct 31, 2022
2 parents 93ee966 + fb90bdd commit 8117b4f
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions fideslog/sdk/python/client.py
Original file line number Diff line number Diff line change
@@ -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 (
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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(
Expand Down

0 comments on commit 8117b4f

Please sign in to comment.