From accf6ab7779d98e3fb0d4790dd2146b0061635a4 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 18 Aug 2018 08:04:56 +0100 Subject: Fix wrong tests for None. --- poezio/windows/inputs.py | 2 +- poezio/windows/text_win.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/poezio/windows/inputs.py b/poezio/windows/inputs.py index b48fe318..6b0bc798 100644 --- a/poezio/windows/inputs.py +++ b/poezio/windows/inputs.py @@ -725,7 +725,7 @@ class CommandInput(HistoryInput): HistoryInput.__init__(self) self.on_abort = on_abort self.on_success = on_success - if on_input is None: + if on_input is not None: self.on_input = on_input else: self.on_input = DEFAULT_ON_INPUT diff --git a/poezio/windows/text_win.py b/poezio/windows/text_win.py index ef7e8f86..76c7d2d7 100644 --- a/poezio/windows/text_win.py +++ b/poezio/windows/text_win.py @@ -374,7 +374,7 @@ class TextWin(BaseTextWin): if get_theme().CHAR_TIME_RIGHT and message.str_time: offset += 1 lines = poopt.cut_text(txt, self.width - offset - 1) - prepend = default_color if default_color is None else '' + prepend = default_color if default_color else '' attrs = [] # type: List[str] for line in lines: saved = Line( @@ -626,7 +626,7 @@ class XMLTextWin(BaseTextWin): if get_theme().CHAR_TIME_RIGHT and message.str_time: offset += 1 lines = poopt.cut_text(txt, self.width - offset - 1) - prepend = default_color if default_color is not None else '' + prepend = default_color if default_color else '' attrs = [] # type: List[str] for line in lines: saved = Line( -- cgit v1.2.3