diff --git a/elpy/blackutil.py b/elpy/blackutil.py index e09ed417..cef08b2e 100644 --- a/elpy/blackutil.py +++ b/elpy/blackutil.py @@ -7,8 +7,10 @@ from elpy.rpc import Fault # in case pkg_resources is not properly installed # (see https://github.com/jorgenschaefer/elpy/issues/1674). +# in case pkg_resources is not properly installed +# (see https://github.com/jorgenschaefer/elpy/issues/1674). try: - from pkg_resources import parse_version + from packaging.version import Version as parse_version except ImportError: # pragma: no cover def parse_version(*arg, **kwargs): raise Fault("`pkg_resources` could not be imported, " diff --git a/elpy/jedibackend.py b/elpy/jedibackend.py index 96b75502..a4aa0c7e 100644 --- a/elpy/jedibackend.py +++ b/elpy/jedibackend.py @@ -18,7 +18,7 @@ # in case pkg_resources is not properly installed # (see https://github.com/jorgenschaefer/elpy/issues/1674). try: - from pkg_resources import parse_version + from packaging.version import Version as parse_version except ImportError: # pragma: no cover def parse_version(*arg, **kwargs): raise Fault("`pkg_resources` could not be imported, "