Skip to content

Commit

Permalink
Restore compatibility for Python 3.11.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jul 14, 2024
1 parent c95c063 commit 4d4ba1b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 1 deletion.
Empty file added irc/compat/__init__.py
Empty file.
Empty file added irc/compat/py311/__init__.py
Empty file.
Empty file.
7 changes: 7 additions & 0 deletions irc/compat/py311/importlib/resources.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import sys


if sys.version_info >= (3, 12):
from importlib.resources import files
else:
from importlib_resources import files # noqa: F401
3 changes: 2 additions & 1 deletion irc/events.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import itertools
from importlib.resources import files

from jaraco.text import clean, drop_comment, lines_from

from .compat.py311.importlib.resources import files


class Code(str):
def __new__(cls, code, name):
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ dependencies = [
"more_itertools",
"tempora>=1.6",
'importlib_metadata; python_version < "3.8"',
'importlib_resources; python_version < "3.12"',
]
dynamic = ["version"]

Expand Down

0 comments on commit 4d4ba1b

Please sign in to comment.