Skip to content

Commit

Permalink
Merge pull request #364 from donkopotamus/fix-enable-vt-processing-2.7
Browse files Browse the repository at this point in the history
Support python-2.7 in enable_vt_processing
  • Loading branch information
njsmith committed Nov 2, 2022
2 parents 6f03975 + 8cf8f6d commit 4349173
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 4349173

Please sign in to comment.