diff --git a/src/common/gajim.py b/src/common/gajim.py index c60b5317c..ee1ba1e94 100644 --- a/src/common/gajim.py +++ b/src/common/gajim.py @@ -32,6 +32,7 @@ import logging import locale import gi import uuid +from distutils.version import LooseVersion as V from common import config import nbxmpp @@ -165,7 +166,19 @@ except ImportError: HAVE_GPG = True GPG_BINARY = 'gpg' try: - __import__('gnupg') + import gnupg + ''' + We need https://pypi.python.org/pypi/python-gnupg + but https://pypi.python.org/pypi/gnupg shares the same package name. + It cannot be used as a drop-in replacement. + We test with a version check if python-gnupg is installed as it is + on a much lower version number than gnupg + Also we need at least python-gnupg 0.3.8 + ''' + v_gnupg = gnupg.__version__ + if V(v_gnupg) < V('0.3.8') or V(v_gnupg) > V('1.0.0'): + log.info('Gajim needs python-gnupg >= 0.3.8') + HAVE_GPG = False except ImportError: HAVE_GPG = False else: