aboutsummaryrefslogtreecommitdiffstats
path: root/tests/gpgme
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2017-04-24 15:32:41 +0000
committerJustus Winter <[email protected]>2017-04-24 15:32:41 +0000
commitef1922b3b19df0aa7f8c15d503c603f76fc13f82 (patch)
treef9ed357ddcfa11f2000bc5f477dcfcf18494fd1f /tests/gpgme
parentgpgscm: Refactor cell finalization. (diff)
downloadgnupg-ef1922b3b19df0aa7f8c15d503c603f76fc13f82.tar.gz
gnupg-ef1922b3b19df0aa7f8c15d503c603f76fc13f82.zip
tests: Fix Python detection.
* tests/gpgme/gpgme-defs.scm (python): Fix Python detection. -- In 25e6444b3f4601c7821beab06bc4520deacb007b we changed the way GPGME creates the build directory for the Python bindings. We now use the basename of the interpreter as an identifier, that means we have to get the base name right, a link to the same binary is not sufficient. Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'tests/gpgme')
-rw-r--r--tests/gpgme/gpgme-defs.scm20
1 files changed, 11 insertions, 9 deletions
diff --git a/tests/gpgme/gpgme-defs.scm b/tests/gpgme/gpgme-defs.scm
index 690d097fd..a74a174f7 100644
--- a/tests/gpgme/gpgme-defs.scm
+++ b/tests/gpgme/gpgme-defs.scm
@@ -167,13 +167,15 @@
(expand-one (append acc (list (car v))) (cdr v))))))
values)))
-(define python (catch #f
- (path-expand "python" (string-split (getenv "PATH") *pathsep*))))
+(define python
+ (let loop ((pythons (list "python" "python2" "python3")))
+ (if (null? pythons)
+ #f
+ (catch (loop (cdr pythons))
+ (unless (file-exists? (path-join gpgme-builddir "lang" "python"
+ (string-append (car pythons) "-gpg")))
+ (throw "next please"))
+ (path-expand (car pythons) (string-split (getenv "PATH") *pathsep*))))))
+
(define (run-python-tests?)
- (and python
- (let* ((python-version
- (string-trim char-whitespace?
- (call-popen `(,python -c "import sys; print('{0}.{1}'.format(sys.version_info[0], sys.version_info[1]))") "")))
- (build-path (path-join gpgme-builddir "lang" "python"
- (string-append "python" python-version "-gpg"))))
- (file-exists? build-path))))
+ (not (not python)))