diff options
Diffstat (limited to 'unittests/machinefiletests.py')
| -rw-r--r-- | unittests/machinefiletests.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/unittests/machinefiletests.py b/unittests/machinefiletests.py index c3802618d..22341cb9a 100644 --- a/unittests/machinefiletests.py +++ b/unittests/machinefiletests.py @@ -215,9 +215,12 @@ class NativeFileTests(BasePlatformTests): # We not have python2, check for it for v in ['2', '2.7', '-2.7']: - rc = subprocess.call(['pkg-config', '--cflags', f'python{v}'], - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL) + try: + rc = subprocess.call(['pkg-config', '--cflags', f'python{v}'], + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL) + except FileNotFoundError: + raise SkipTest('Not running Python 2 tests because pkg-config not found.') if rc == 0: break else: |
