Skip to content

Commit

Permalink
Rely on importlib.metadata from stdlib on Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Dec 20, 2019
1 parent c68ce7a commit 4d5beef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions irc/client.py
Expand Up @@ -62,12 +62,16 @@
import contextlib
import warnings

try:
from importlib import metadata
except ImportError:
import importlib_metadata as metadata

import jaraco.functools
from jaraco.itertools import always_iterable, infinite_call
from jaraco.functools import Throttler
from jaraco.stream import buffer
from more_itertools.recipes import consume
import importlib_metadata

from . import connection
from . import events
Expand All @@ -80,7 +84,7 @@

# set the version tuple
try:
VERSION_STRING = importlib_metadata.version('irc')
VERSION_STRING = metadata.version('irc')
VERSION = tuple(int(res) for res in re.findall(r'\d+', VERSION_STRING))
except Exception:
VERSION_STRING = 'unknown'
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -31,7 +31,7 @@ install_requires =
pytz
more_itertools
tempora>=1.6
importlib_metadata
importlib_metadata; python_version < "3.8"
setup_requires = setuptools_scm >= 1.15.0

[options.extras_require]
Expand Down

0 comments on commit 4d5beef

Please sign in to comment.