Skip to content

Commit

Permalink
Replace pkg_resources.parse_version by packaging.version.Version
Browse files Browse the repository at this point in the history
  • Loading branch information
berhoel committed Dec 17, 2023
1 parent 7ff8ffa commit a7ae274
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion elpy/blackutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, "
Expand Down
2 changes: 1 addition & 1 deletion elpy/jedibackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, "
Expand Down

0 comments on commit a7ae274

Please sign in to comment.