Use a better version handler.
authorIvan Alejandro <ivanalejandro0@gmail.com>
Thu, 9 Jan 2014 19:53:19 +0000 (16:53 -0300)
committerIvan Alejandro <ivanalejandro0@gmail.com>
Thu, 9 Jan 2014 19:54:37 +0000 (16:54 -0300)
changes/feature-use-better-version-handler [new file with mode: 0644]
src/leap/keymanager/__init__.py

diff --git a/changes/feature-use-better-version-handler b/changes/feature-use-better-version-handler
new file mode 100644 (file)
index 0000000..57fabcc
--- /dev/null
@@ -0,0 +1 @@
+  o Use a better version handler for the gnupg version check.
index aa4e2e7..4edcdd0 100644 (file)
@@ -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 "*******"