From c4d1b05fc4bc3e4fddc6b890e3ad1498edf22e55 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Fri, 13 Jan 2023 15:53:54 +0100 Subject: meson.build: Simplify if-file-exists test --- meson.build | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index 974ae2ae..838d42d8 100644 --- a/meson.build +++ b/meson.build @@ -165,16 +165,8 @@ if maintainer_mode project_source_root / 'untracked' / 'docs', check: true, ) -else - cmd_py = ''' -import os -import sys -sys.exit(os.path.isfile("@0@")) -'''.format(generate_binding_py) - file_exists = run_command(python3, '-c', cmd_py, check: false).returncode() != 0 - if not file_exists - error('Missing files in untracked/. You must enable maintainer-mode.') - endif +elif not import('fs').is_file(generate_binding_py) + error('Missing files in untracked/. You must enable maintainer-mode.') endif # Check if perl is required and available. -- cgit v1.2.1