Skip to content

Commit 2f9e062

Browse files
committed
Use importlib_metadata on Python 3.8
1 parent 0cba208 commit 2f9e062

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

domdf_python_tools/compat.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,15 @@
1515
1616
.. py:data:: importlib_metadata
1717
18-
`importlib_metadata <https://importlib-metadata.readthedocs.io/en/latest/>`_ on Python 3.7 and earlier;
19-
:mod:`importlib.metadata` on Python 3.8 and later.
18+
`importlib_metadata <https://importlib-metadata.readthedocs.io/en/latest/>`_ on Python 3.8 and earlier;
19+
:mod:`importlib.metadata` on Python 3.9 and later.
2020
2121
.. versionadded:: 1.1.0
22+
23+
.. versionchanged:: 2.5.0
24+
25+
`importlib_metadata <https://importlib-metadata.readthedocs.io/en/latest/>`_ is now used
26+
on Python 3.8 in place of the stdlib version.
2227
"""
2328
#
2429
# Copyright © 2020 Dominic Davis-Foster <[email protected]>
@@ -56,10 +61,10 @@
5661
# stdlib
5762
import importlib.resources as importlib_resources
5863

59-
if sys.version_info[:2] < (3, 8): # pragma: no cover (>=py38)
64+
if sys.version_info[:2] < (3, 9): # pragma: no cover (>=py39)
6065
# 3rd party
6166
import importlib_metadata
62-
else: # pragma: no cover (<py38)
67+
else: # pragma: no cover (<py39)
6368
# stdlib
6469
import importlib.metadata as importlib_metadata
6570

0 commit comments

Comments
 (0)