End compile-handlebars-templates gracefully.

Catch KeyboardInterrupt from tools/compile-handlebars-templates,
print a message and exit when running in forever mode.
This commit is contained in:
Eklavya Sharma 2016-05-24 20:50:48 +05:30 committed by Tim Abbott
parent 1ea6171179
commit 09400a7e50

View File

@ -47,5 +47,9 @@ def run_forever():
if __name__ == '__main__':
if len(sys.argv) == 2 and sys.argv[1] == 'forever':
run_forever()
run()
try:
run_forever()
except KeyboardInterrupt:
print(sys.argv[0], "exited after receiving KeyboardInterrupt")
else:
run()