Skip to content

Commit d4e903d

Browse files
authored
Replace pkg_resources with importlib
`pkg_resources` has been removed and can be replaced with `importlib` (present since python 3.8)
1 parent 5b361f7 commit d4e903d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

docs/source/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
from pkg_resources import DistributionNotFound, get_distribution
1+
from importlib.metadata import PackageNotFoundError, version
22

33
try:
4-
__version__ = get_distribution("pspy").version
5-
except DistributionNotFound:
4+
__version__ = version("pspy")
5+
except PackageNotFoundError:
66
__version__ = "unknown version"
77

88
import os

0 commit comments

Comments
 (0)