Merge pull request #2277 from xonsh/fix_history_replay

only remove attribute if it exists
This commit is contained in:
Anthony Scopatz 2017-02-27 15:29:46 -05:00 committed by GitHub
commit 0973539c5c
2 changed files with 16 additions and 1 deletions

View file

@ -0,0 +1,14 @@
**Added:** None
**Changed:** None
**Deprecated:** None
**Removed:** None
**Fixed:**
* ``history replay`` no longer barfs on ``style_name`` when setting up the
environment
**Security:** None

View file

@ -1576,7 +1576,8 @@ def intensify_colors_on_win_setter(enable):
"""
enable = to_bool(enable)
if hasattr(builtins, '__xonsh_shell__'):
delattr(builtins.__xonsh_shell__.shell.styler, 'style_name')
if hasattr(builtins.__xonsh_shell__.shell.styler, 'style_name'):
delattr(builtins.__xonsh_shell__.shell.styler, 'style_name')
return enable