summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changes/feature-use-better-version-handler1
-rw-r--r--src/leap/keymanager/__init__.py6
2 files changed, 4 insertions, 3 deletions
diff --git a/changes/feature-use-better-version-handler b/changes/feature-use-better-version-handler
new file mode 100644
index 00000000..57fabcc3
--- /dev/null
+++ b/changes/feature-use-better-version-handler
@@ -0,0 +1 @@
+ o Use a better version handler for the gnupg version check.
diff --git a/src/leap/keymanager/__init__.py b/src/leap/keymanager/__init__.py
index aa4e2e72..4edcdd0c 100644
--- a/src/leap/keymanager/__init__.py
+++ b/src/leap/keymanager/__init__.py
@@ -23,9 +23,9 @@ import sys
try:
from gnupg.gnupg import GPGUtilities
assert(GPGUtilities) # pyflakes happy
- from gnupg import __version__
- from distutils.version import LooseVersion as V
- assert(V(__version__) >= V('1.2.3'))
+ from gnupg import __version__ as _gnupg_version
+ from pkg_resources import parse_version
+ assert(parse_version(_gnupg_version) >= parse_version('1.2.3'))
except (ImportError, AssertionError):
print "*******"