Skip to content

Commit 2d978e2

Browse files
committed
formatHTML - Intercept control+c when reading HTML from stdin and exit cleanly in that case.
1 parent c14c0a1 commit 2d978e2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

formatHTML

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ if __name__ == '__main__':
105105
sys.stderr.write('Input file "%s" does not exist.\n' %(inFilename,))
106106
sys.exit(1)
107107
else:
108-
inData = sys.stdin.read()
108+
try:
109+
inData = sys.stdin.read()
110+
except KeyboardInterrupt:
111+
# Intercept control+c and exit cleanly
112+
sys.exit(1)
109113

110114
if outFilename:
111115
try:

0 commit comments

Comments
 (0)