Skip to content

Commit 0e4a429

Browse files
authored
Merge pull request #8492 from chaen/v8.0_fix_pkg_resources
fix: pkg_resources deprecation warnings
2 parents 7137bfe + 408b5e6 commit 0e4a429

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/DIRAC/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@
5555
5656
"""
5757
import os
58+
import importlib.metadata
5859
import re
5960
import sys
6061
import warnings
6162
from pkgutil import extend_path
6263
from typing import Any, Optional, Union
63-
from pkg_resources import get_distribution, DistributionNotFound
6464

6565

6666
__path__ = extend_path(__path__, __name__)
@@ -81,9 +81,9 @@
8181

8282
# Define Version
8383
try:
84-
__version__ = get_distribution(__name__).version
84+
__version__ = importlib.metadata.version(__name__)
8585
version = __version__
86-
except DistributionNotFound:
86+
except importlib.metadata.PackageNotFoundError:
8787
# package is not installed
8888
version = "Unknown"
8989

0 commit comments

Comments
 (0)