[Pkg-gnupg-commit] [gpgme] 157/412: python: Initialize GPGME for the user.
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Thu Sep 22 21:26:38 UTC 2016
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch master
in repository gpgme.
commit ae06f7c2fe0e49baeab5a827dc38ba8c57a6404c
Author: Justus Winter <justus at g10code.com>
Date: Thu Jun 2 15:18:40 2016 +0200
python: Initialize GPGME for the user.
* lang/python/pyme/core.py: Call 'check_version' and explain why.
* lang/python/tests/support.py (init_gpgme): Drop call here.
Signed-off-by: Justus Winter <justus at g10code.com>
---
lang/python/pyme/core.py | 6 ++++++
lang/python/tests/support.py | 1 -
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/lang/python/pyme/core.py b/lang/python/pyme/core.py
index 8deeb90..71c6828 100644
--- a/lang/python/pyme/core.py
+++ b/lang/python/pyme/core.py
@@ -572,6 +572,12 @@ def get_protocol_name(proto):
def check_version(version=None):
return pygpgme.gpgme_check_version(version)
+# check_version also makes sure that several subsystems are properly
+# initialized, and it must be run at least once before invoking any
+# other function. We do it here so that the user does not have to do
+# it unless she really wants to check for a certain version.
+check_version()
+
def engine_check_version (proto):
try:
errorcheck(pygpgme.gpgme_engine_check_version(proto))
diff --git a/lang/python/tests/support.py b/lang/python/tests/support.py
index 99d96cf..8bafea8 100644
--- a/lang/python/tests/support.py
+++ b/lang/python/tests/support.py
@@ -23,7 +23,6 @@ def make_filename(name):
return os.path.join(os.environ['top_srcdir'], 'tests', 'gpg', name)
def init_gpgme(proto):
- core.check_version()
core.engine_check_version(proto)
verbose = int(os.environ.get('verbose', 0)) > 1
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gpgme.git
More information about the Pkg-gnupg-commit
mailing list