Skip to content

Commit

Permalink
Avoid the Flake8 warning and restore conditional import
Browse files Browse the repository at this point in the history
We were so far only optionally requiring the packaging dependency
  • Loading branch information
dirkmueller committed Jan 18, 2023
1 parent 5b44109 commit d4150d2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions set_version
Expand Up @@ -25,10 +25,9 @@ import tarfile
import zipfile
import codecs
import logging
import packaging

try:
from packaging.version import Version, parse
from packaging.version import InvalidVersion, Version, parse
except ImportError:
HAS_PACKAGING = False
import warnings
Expand Down Expand Up @@ -346,7 +345,7 @@ def _version_python_pip2rpm(version_pip):

try:
v = parse(version_pip)
except packaging.version.InvalidVersion:
except InvalidVersion:
# Maybe is converted already?
return None

Expand Down

0 comments on commit d4150d2

Please sign in to comment.