You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
828 B
27 lines
828 B
https://dev.gnupg.org/T6778
|
|
--- a/lang/python/tests/support.py
|
|
+++ b/lang/python/tests/support.py
|
|
@@ -46,13 +46,15 @@ def is_gpg_version(version):
|
|
|
|
|
|
def have_tofu_support(ctx, some_uid):
|
|
- keys = list(
|
|
- ctx.keylist(
|
|
- some_uid,
|
|
- mode=(gpg.constants.keylist.mode.LOCAL |
|
|
- gpg.constants.keylist.mode.WITH_TOFU)))
|
|
- return len(keys) > 0
|
|
-
|
|
+ try:
|
|
+ keys = list(
|
|
+ ctx.keylist(
|
|
+ some_uid,
|
|
+ mode=(gpg.constants.keylist.mode.LOCAL |
|
|
+ gpg.constants.keylist.mode.WITH_TOFU)))
|
|
+ return len(keys) > 0
|
|
+ except gpg.errors.GPGMEError:
|
|
+ return False
|
|
|
|
# Skip the Python tests for GnuPG < 2.1.12. Prior versions do not
|
|
# understand the command line flags that we assume exist. C.f. issue
|