Skip to content

Commit

Permalink
Ensure compatibility with Python 3.12+ for override import
Browse files Browse the repository at this point in the history
  • Loading branch information
realshouzy committed May 15, 2024
1 parent ea87049 commit aae8f5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion nrw/network/_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@
__all__: Final[tuple[str]] = ("Server",)

import socket
import sys
import threading
from abc import ABC, abstractmethod
from contextlib import suppress
from typing import TYPE_CHECKING, Final, override
from typing import TYPE_CHECKING, Final

from nrw.datastructures import List

if sys.version_info >= (3, 12): # pragma: >=3.12 cover
from typing import override
else: # pragma: <3.12 cover
from typing_extensions import override

if TYPE_CHECKING:
from io import TextIOWrapper

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mysql-connector-python
pyodbc;platform_python_implementation=="CPython"
pypyodbc;platform_python_implementation=="PyPy"
typing_extensions>=4.4.0;python_version<"3.12"

0 comments on commit aae8f5b

Please sign in to comment.