]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Fix return value when exiting with Ctrl-C.
authorCollin Funk <collin.funk1@gmail.com>
Fri, 17 May 2024 01:26:50 +0000 (18:26 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Fri, 17 May 2024 01:26:50 +0000 (18:26 -0700)
* pygnulib/main.py (main_with_exception_handling): Catch
KeyboardInterrupts and exit with a return code of 1.

ChangeLog
pygnulib/main.py

index bb2deb676691ee111533acd20a276fad4534d950..ba52fbcdf18b054df7e0061667fb810d514b7afd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-05-16  Collin Funk  <collin.funk1@gmail.com>
+
+       gnulib-tool.py: Fix return value when exiting with Ctrl-C.
+       * pygnulib/main.py (main_with_exception_handling): Catch
+       KeyboardInterrupts and exit with a return code of 1.
+
 2024-05-16  Collin Funk  <collin.funk1@gmail.com>
 
        unsetenv tests: Update module dependencies.
index b693e71d7fc306147f553f26b99a8e256c4bc404..68be0ba28f1c33629ba211f49c477a99ddcf4f74 100644 (file)
@@ -1380,6 +1380,9 @@ def main_with_exception_handling() -> None:
     try:  # Try to execute
         with tempfile.TemporaryDirectory(prefix='glpy') as temporary_directory:
             main(temporary_directory)
+    except KeyboardInterrupt:
+        sys.stderr.write('%s: *** Stop.\n' % APP['name'])
+        sys.exit(1)
     except GLError as error:
         errmode = 0  # gnulib-style errors
         errno = error.errno