diff options
author | Alberto García Hierro <alberto@garciahierro.com> | 2019-11-16 17:12:56 +0000 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-11-17 13:54:38 +0200 |
commit | ffa9459eedb67e9d44f377c4e012d8e27a948b36 (patch) | |
tree | c13aaaa941438a8e8efb611758e617009eb7145c /mesonbuild/scripts | |
parent | 1baa1c92220d23a91337e8aa1e174c66f7fd0531 (diff) | |
download | meson-ffa9459eedb67e9d44f377c4e012d8e27a948b36.zip meson-ffa9459eedb67e9d44f377c4e012d8e27a948b36.tar.gz meson-ffa9459eedb67e9d44f377c4e012d8e27a948b36.tar.bz2 |
commandrunner: Forward KeyboardInterrupt to command
Some commands, notably gdb, use ctrl+c themselves to perform actions
without exiting. Instead of making meson exit and thus, kill the
subprocess, ignore the KeyboardInterrupt and continue waiting for
the child.
Diffstat (limited to 'mesonbuild/scripts')
-rw-r--r-- | mesonbuild/scripts/commandrunner.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mesonbuild/scripts/commandrunner.py b/mesonbuild/scripts/commandrunner.py index 3807114..22da417 100644 --- a/mesonbuild/scripts/commandrunner.py +++ b/mesonbuild/scripts/commandrunner.py @@ -71,7 +71,12 @@ def run(args): command = args[4] arguments = args[5:] pc = run_command(src_dir, build_dir, subdir, meson_command, command, arguments) - pc.wait() + while True: + try: + pc.wait() + break + except KeyboardInterrupt: + pass return pc.returncode if __name__ == '__main__': |