Fix bug in determining behaviours for those using GnuPG2 binaries.

This bug caused some extra behaviours which should only be invoked if
the user is using a gpg2 binary. It was caused by checking:

    if _util._is_gpg2:

which is always true, since `_util._is_gpg2` is a function which isn't
being called in this case, i.e.:

    >>> def foo(): return False
    >>> bool(foo)
    True

So instead this should be changed to actually call `_util._is_gpg2()`,
by using `gnupg.GPG.is_gpg2()` which will automatically pass in the
detected binary version number.
fix/44-verbose-arg
Isis Lovecruft 2014-09-24 22:13:25 +00:00
parent 5ad99acd7c
commit 69cc991938
No known key found for this signature in database
GPG Key ID: 18C16EC5F9F1D673
1 changed files with 1 additions and 1 deletions

View File

@ -156,7 +156,7 @@ class GPG(GPGBase):
self.binary_version = version_line.split('\n')[0]
log.debug("Using GnuPG version %s" % self.binary_version)
if _util._is_gpg2:
if self.is_gpg2():
# Make GnuPG>=2.0.0-only methods public:
self.fix_trustdb = self._fix_trustdb
self.import_ownertrust = self._import_ownertrust