summaryrefslogtreecommitdiff
path: root/cmd2
diff options
context:
space:
mode:
Diffstat (limited to 'cmd2')
-rw-r--r--cmd2/cmd2.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index 31399620..07e7fcec 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -563,8 +563,9 @@ class Cmd(cmd.Cmd):
@allow_ansi.setter
def allow_ansi(self, new_val: str) -> None:
- """Read-only property needed to support do_set when it sets allow_ansi"""
- if new_val.lower() not in (ansi.ANSI_TERMINAL.lower(), ansi.ANSI_ALWAYS.lower(), ansi.ANSI_NEVER.lower()):
+ """Setter property needed to support do_set when it updates allow_ansi"""
+ new_val = new_val.capitalize()
+ if new_val not in (ansi.ANSI_TERMINAL, ansi.ANSI_ALWAYS, ansi.ANSI_NEVER):
self.perror('Invalid value: {} (valid values: {}, {}, {})'.format(new_val, ansi.ANSI_TERMINAL,
ansi.ANSI_ALWAYS, ansi.ANSI_NEVER))
else: