diff --git a/docs/changes.rst b/docs/changes.rst index 98d376e0..56245976 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -23,6 +23,8 @@ all releases are available on `PyPI `_ and - :gh:`93` fixes the display of parametrized arguments in the console. - :gh:`94` adds ``--show-locals`` which allows to print local variables in tracebacks. - :gh:`96` implements a spinner to show the progress during the collection. +- :gh:`99` enables color support for WSL in Windows Terminal and fixes ``show_locals`` + in ``collect.py``. 0.0.14 - 2021-03-23 diff --git a/src/_pytask/collect.py b/src/_pytask/collect.py index 5f226c8a..d0ab094a 100644 --- a/src/_pytask/collect.py +++ b/src/_pytask/collect.py @@ -259,7 +259,11 @@ def pytask_collect_log(session, reports, tasks): console.print() - console.print(Traceback.from_exception(*report.exc_info, show_locals=True)) + console.print( + Traceback.from_exception( + *report.exc_info, show_locals=session.config["show_locals"] + ) + ) console.print() diff --git a/src/_pytask/console.py b/src/_pytask/console.py index b72f6374..34603cd7 100644 --- a/src/_pytask/console.py +++ b/src/_pytask/console.py @@ -13,7 +13,7 @@ _IS_WINDOWS = sys.platform == "win32" -if (_IS_WINDOWS and not _IS_WINDOWS_TERMINAL) or _IS_WSL: +if (_IS_WINDOWS or _IS_WSL) and not _IS_WINDOWS_TERMINAL: _IS_LEGACY_WINDOWS = True else: _IS_LEGACY_WINDOWS = False