Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
1.3.2b2 (2021-09-29)
^^^^^^^^^^^^^^^^^^^^

* Fix error NotImplemented for Windows OS and Python >= 3.8 `#881 <https://github.com/aio-libs/aiopg/pull/881>`_


1.3.2b1 (2021-07-11)
^^^^^^^^^^^^^^^^^^^^

Expand Down
20 changes: 19 additions & 1 deletion aiopg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,25 @@
Union,
)

if sys.version_info >= (3, 7, 0):

def is_win_os() -> bool:
return sys.platform == 'win32'


class PythonVersion:
@staticmethod
def is_38_or_high() -> bool:
return sys.version_info >= (3, 8, 0)

@staticmethod
def is_37_or_high() -> bool:
return sys.version_info >= (3, 7, 0)


if PythonVersion.is_38_or_high() and is_win_os():
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
__get_running_loop = asyncio.get_running_loop
elif PythonVersion.is_37_or_high():
__get_running_loop = asyncio.get_running_loop
else:

Expand Down