From fb00efccfad8a926a49f14faad2eb56b0ae70f49 Mon Sep 17 00:00:00 2001 From: Gyuri Horak Date: Sat, 1 Feb 2020 13:05:03 +0100 Subject: [PATCH] Fix for `AttributeError` in `LsColors` when `XonshSession` has no `env` attribute --- xonsh/environ.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xonsh/environ.py b/xonsh/environ.py index bdfde55902..622833a7ea 100644 --- a/xonsh/environ.py +++ b/xonsh/environ.py @@ -383,8 +383,8 @@ def detype(self): @property def style_name(self): """Current XONSH_COLOR_STYLE value""" - env = builtins.__xonsh__.env - env_style_name = env.get("XONSH_COLOR_STYLE") + env = getattr(builtins.__xonsh__, "env", {}) + env_style_name = env.get("XONSH_COLOR_STYLE", "default") if self._style_name is None or self._style_name != env_style_name: self._style_name = env_style_name self._style = self._dtyped = None