diff options
author | da-woods <dw-git@d-woods.co.uk> | 2021-10-01 10:22:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-01 11:22:36 +0200 |
commit | 494f517e622f8a9e43f490408ec244a785d556e2 (patch) | |
tree | c087538602a7a374d8a83984716eaa41fe38fdaf | |
parent | cce3693f14060433fcf52e2ba034c1b77a26c9e5 (diff) | |
download | cython-494f517e622f8a9e43f490408ec244a785d556e2.tar.gz |
Change gcc version check in test runner to a numeric comparison (GH-4359)
The string comparison was reporting '11' < '4' (so OpenMP tests were being skipped on GCC 11)
-rwxr-xr-x | runtests.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/runtests.py b/runtests.py index 6622f9c67..91dbfccda 100755 --- a/runtests.py +++ b/runtests.py @@ -415,8 +415,10 @@ def get_openmp_compiler_flags(language): COMPILER_HAS_INT128 = getattr(sys, 'maxsize', getattr(sys, 'maxint', 0)) > 2**60 compiler_version = gcc_version.group(1) - if compiler_version and compiler_version.split('.') >= ['4', '2']: - return '-fopenmp', '-fopenmp' + if compiler_version: + compiler_version = [int(num) for num in compiler_version.split('.')] + if compiler_version >= [4, 2]: + return '-fopenmp', '-fopenmp' try: locale.setlocale(locale.LC_ALL, '') |