Add a note about why we play with file descriptors
This commit is contained in:
parent
f8991ce3c8
commit
5338fcdc1e
@ -495,6 +495,8 @@ def main(args: List[str]) -> Response:
|
|||||||
loop.loop(phandler)
|
loop.loop(phandler)
|
||||||
return {'items': items, 'response': phandler.response}
|
return {'items': items, 'response': phandler.response}
|
||||||
|
|
||||||
|
# we do this file descriptor dance to get readline to work even when STDOUT
|
||||||
|
# is redirected
|
||||||
orig_stdout = os.dup(sys.stdout.fileno())
|
orig_stdout = os.dup(sys.stdout.fileno())
|
||||||
try:
|
try:
|
||||||
with open(os.ctermid(), 'r') as tty:
|
with open(os.ctermid(), 'r') as tty:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user