mirror of https://github.com/streamlink/streamlink
streamlink_cli.main: close stream_fd on exit (#427)
* streamlink_cli.main: close stream_fd on exit * streamlink_cli.main: don't close output in finnaly * streamlink_cli.main: added 'except KeyboardInterrupt' in finnaly block * changed console message type
This commit is contained in:
parent
b2b6d5b28c
commit
0b334a09d7
|
@ -931,16 +931,14 @@ def main():
|
|||
# Close output
|
||||
if output:
|
||||
output.close()
|
||||
|
||||
# Make sure current stream gets properly cleaned up
|
||||
console.msg("Interrupted! Exiting...")
|
||||
finally:
|
||||
if stream_fd:
|
||||
console.msg("Interrupted! Closing currently open stream...")
|
||||
try:
|
||||
console.logger.info("Closing currently open stream...")
|
||||
stream_fd.close()
|
||||
except KeyboardInterrupt:
|
||||
sys.exit()
|
||||
else:
|
||||
console.msg("Interrupted! Exiting...")
|
||||
elif args.twitch_oauth_authenticate:
|
||||
authenticate_twitch_oauth()
|
||||
elif args.help:
|
||||
|
|
Loading…
Reference in New Issue