Skip to content

Commit

Permalink
Detached stream fix
Browse files Browse the repository at this point in the history
  • Loading branch information
3tilley committed Oct 28, 2021
1 parent 7899683 commit 788106f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion colorama/ansitowin32.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ def closed(self):
stream = self.__wrapped
try:
return stream.closed
except AttributeError:
# AttributeError in the case that the stream doesn't support being closed
# ValueError for the case that the stream has already been detached when atexit runs
except (AttributeError, ValueError):
return True


Expand Down

0 comments on commit 788106f

Please sign in to comment.