Skip to content

Commit efb4dd1

Browse files
committed
End input by Ctrl+D
1 parent 1b7bfe7 commit efb4dd1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

gh.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ def call_query(cmd, query):
275275

276276

277277
def read_body(prompt):
278+
"""Input line by line, CTRL+D to end, CTRL+C to cancel"""
278279
lines = []
279280

280281
try:
@@ -284,6 +285,8 @@ def read_body(prompt):
284285
print()
285286
lines.append(s)
286287
s = input()
288+
except EOFError:
289+
pass
287290
except KeyboardInterrupt:
288291
lines.clear()
289292
print('Abort by user, there is nothing to do')

0 commit comments

Comments
 (0)