Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions spotify_ripper/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,9 +591,12 @@ def check_uri_args():

# wait for ripping thread to finish
if not args.has_log:
stdin_settings = termios.tcgetattr(sys.stdin)
try:
stdin_settings = termios.tcgetattr(sys.stdin)
except termios.error:
stdin_settings = None
try:
if not args.has_log:
if not args.has_log and stdin_settings:
tty.setcbreak(sys.stdin.fileno())

while ripper.isAlive():
Expand All @@ -611,7 +614,7 @@ def check_uri_args():
print("\n" + Fore.RED + "Aborting..." + Fore.RESET)
abort()
finally:
if not args.has_log:
if not args.has_log and stdin_settings:
termios.tcsetattr(sys.stdin, termios.TCSADRAIN, stdin_settings)

if __name__ == '__main__':
Expand Down