Skip to content

Commit 1413a62

Browse files
authored
Remove colorama. (#305)
1 parent 3f79727 commit 1413a62

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

docs/source/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and
99

1010
- {pull}`297` moves non-hook functions from `warnings.py` to `warnings_utils.py` and
1111
publishes them so that pytask-parallel can import them.
12+
- {pull}`305` removes traces of colorama. Whatever it did should be handled by rich.
1213

1314
## 0.2.5 - 2022-08-02
1415

src/_pytask/capture.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ def pytask_parse_config(
122122
@hookimpl
123123
def pytask_post_parse(config: dict[str, Any]) -> None:
124124
"""Initialize the CaptureManager."""
125-
_colorama_workaround()
126-
127125
pluginmanager = config["pm"]
128126
capman = CaptureManager(config["capture"])
129127
pluginmanager.register(capman, "capturemanager")
@@ -135,21 +133,6 @@ def pytask_post_parse(config: dict[str, Any]) -> None:
135133
# Copied from pytest with slightly modified docstrings.
136134

137135

138-
def _colorama_workaround() -> None:
139-
"""Ensure colorama is imported so that it attaches to the correct stdio handles on
140-
Windows.
141-
142-
colorama uses the terminal on import time. So if something does the first import of
143-
colorama while I/O capture is active, colorama will fail in various ways.
144-
145-
"""
146-
if sys.platform.startswith("win32"):
147-
try:
148-
import colorama # noqa: F401
149-
except ImportError:
150-
pass
151-
152-
153136
# IO Helpers.
154137

155138

0 commit comments

Comments
 (0)