Skip to content

Commit

Permalink
Support python-2.7 in enable_vt_processing
Browse files Browse the repository at this point in the history
In `python-2.7`, when running in `msys` or `git-bash` based terminals, calls to `enable_vt_processing` will fail with an `IOError`
  • Loading branch information
donkopotamus committed Nov 2, 2022
1 parent 6f03975 commit 8cf8f6d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions colorama/winterm.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,6 @@ def enable_vt_processing(fd):
mode = win32.GetConsoleMode(handle)
if mode & win32.ENABLE_VIRTUAL_TERMINAL_PROCESSING:
return True
# Can get TypeError in testsuite where 'fd' is a Mock()
except (OSError, TypeError):
# Can get TypeError in testsuite where 'fd' is a Mock() and IOError in python2.7
except (IOError, OSError, TypeError):
return False

0 comments on commit 8cf8f6d

Please sign in to comment.