Skip to content

Commit

Permalink
improve has_terminal()
Browse files Browse the repository at this point in the history
This commit improves the code of `has_terminal()`
to work properly on OSX, if no terminal is
configured, i.e. no terminal is available.
Under OSX an `OSError` will be raised, which
is now properly caught.
  • Loading branch information
christian-monch committed Apr 11, 2024
1 parent 8cc68b2 commit 2810073
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datalad/ui/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,5 @@ def has_terminal():
try:
open('/dev/tty', 'r').close()
return True
except IOError as exc:
except (IOError, OSError):
return False

0 comments on commit 2810073

Please sign in to comment.