From a1ea5f2af6d0db393973b939a64779c7e10ac8c8 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Wed, 17 Oct 2018 22:45:13 -0400 Subject: [PATCH] fix get_running_loop on python 3.6 --- aioupnp/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aioupnp/__init__.py b/aioupnp/__init__.py index 74e7514..735974e 100644 --- a/aioupnp/__init__.py +++ b/aioupnp/__init__.py @@ -4,3 +4,9 @@ __author__ = "Jack Robison" __maintainer__ = "Jack Robison" __license__ = "MIT" __email__ = "jackrobison@lbry.io" + +import sys +import asyncio + +if not hasattr(asyncio, "get_running_loop") and hasattr(asyncio, "_get_running_loop"): # python 3.6 + setattr(sys.modules['asyncio'], "get_running_loop", asyncio._get_running_loop)