Skip to content

Commit f17f499

Browse files
authored
Enable color support in WSL + Windows Terminal and fix show_locals. (#99)
1 parent 41418d4 commit f17f499

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

docs/changes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ all releases are available on `PyPI <https://pypi.org/project/pytask>`_ and
2323
- :gh:`93` fixes the display of parametrized arguments in the console.
2424
- :gh:`94` adds ``--show-locals`` which allows to print local variables in tracebacks.
2525
- :gh:`96` implements a spinner to show the progress during the collection.
26+
- :gh:`99` enables color support for WSL in Windows Terminal and fixes ``show_locals``
27+
in ``collect.py``.
2628

2729

2830
0.0.14 - 2021-03-23

src/_pytask/collect.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,11 @@ def pytask_collect_log(session, reports, tasks):
259259

260260
console.print()
261261

262-
console.print(Traceback.from_exception(*report.exc_info, show_locals=True))
262+
console.print(
263+
Traceback.from_exception(
264+
*report.exc_info, show_locals=session.config["show_locals"]
265+
)
266+
)
263267

264268
console.print()
265269

src/_pytask/console.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
_IS_WINDOWS = sys.platform == "win32"
1414

1515

16-
if (_IS_WINDOWS and not _IS_WINDOWS_TERMINAL) or _IS_WSL:
16+
if (_IS_WINDOWS or _IS_WSL) and not _IS_WINDOWS_TERMINAL:
1717
_IS_LEGACY_WINDOWS = True
1818
else:
1919
_IS_LEGACY_WINDOWS = False

0 commit comments

Comments
 (0)