[llvm] r318572 - [lit] Try to improve Ctrl-C behavior on Windows
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 17 15:52:33 PST 2017
Author: rnk
Date: Fri Nov 17 15:52:33 2017
New Revision: 318572
URL: http://llvm.org/viewvc/llvm-project?rev=318572&view=rev
Log:
[lit] Try to improve Ctrl-C behavior on Windows
This functionality was broken during a refactor a while back because
'pool' is no longer in scope.
Modified:
llvm/trunk/utils/lit/lit/run.py
Modified: llvm/trunk/utils/lit/lit/run.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/run.py?rev=318572&r1=318571&r2=318572&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/run.py (original)
+++ llvm/trunk/utils/lit/lit/run.py Fri Nov 17 15:52:33 2017
@@ -71,6 +71,16 @@ class Run(object):
(self.lit_config,
self.parallelism_semaphores))
+ # Install a console-control signal handler on Windows.
+ if win32api is not None:
+ def console_ctrl_handler(type):
+ print('\nCtrl-C detected, terminating.')
+ pool.terminate()
+ pool.join()
+ abort_now()
+ return True
+ win32api.SetConsoleCtrlHandler(console_ctrl_handler, True)
+
try:
async_results = [pool.apply_async(worker_run_one_test,
args=(test_index, test),
@@ -126,16 +136,6 @@ class Run(object):
if not self.tests or jobs == 0:
return
- # Install a console-control signal handler on Windows.
- if win32api is not None:
- def console_ctrl_handler(type):
- print('\nCtrl-C detected, terminating.')
- pool.terminate()
- pool.join()
- abort_now()
- return True
- win32api.SetConsoleCtrlHandler(console_ctrl_handler, True)
-
# Save the display object on the runner so that we can update it from
# our task completion callback.
self.display = display
More information about the llvm-commits
mailing list