diff options
author | Justus Winter <[email protected]> | 2017-03-20 15:53:29 +0000 |
---|---|---|
committer | Justus Winter <[email protected]> | 2017-03-20 15:53:29 +0000 |
commit | 57e64d019d993fdeb4323def5352f8ecc98c6fd9 (patch) | |
tree | da5e264ea34d592b6c4ce8d865a29f4b5942227f /lang/python/tests/support.py | |
parent | tests: Use 'gpg-agent --allow-loopback-pinentry' if applicable. (diff) | |
download | gpgme-57e64d019d993fdeb4323def5352f8ecc98c6fd9.tar.gz gpgme-57e64d019d993fdeb4323def5352f8ecc98c6fd9.zip |
python: Fix version check.
* lang/python/tests/support.py (assert_gpg_version): Cope with
non-released versions.
Fixes-commit: e1cf8bab319ba1dea41ba5d711dbb66ffd8e6fd6
Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'lang/python/tests/support.py')
-rw-r--r-- | lang/python/tests/support.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lang/python/tests/support.py b/lang/python/tests/support.py index 8f9d6452..611986b9 100644 --- a/lang/python/tests/support.py +++ b/lang/python/tests/support.py @@ -22,13 +22,15 @@ import contextlib import shutil import sys import os +import re import tempfile import time import gpg def assert_gpg_version(version=(2, 1, 0)): with gpg.Context() as c: - if tuple(map(int, c.engine_info.version.split('.'))) < version: + clean_version = re.match(r'\d+\.\d+\.\d+', c.engine_info.version).group(0) + if tuple(map(int, clean_version.split('.'))) < version: print("GnuPG too old: have {0}, need {1}.".format( c.engine_info.version, '.'.join(version))) sys.exit(77) |