From 2bec2b218a7533da98f3f0bee24c9ec8884a1851 Mon Sep 17 00:00:00 2001 From: Kit Choi Date: Mon, 6 Jul 2020 18:04:56 +0100 Subject: [PATCH] Fix error due to comparing None with int (#969) --- traitsui/wx/tabular_editor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/traitsui/wx/tabular_editor.py b/traitsui/wx/tabular_editor.py index 817d29873..b7dc05684 100644 --- a/traitsui/wx/tabular_editor.py +++ b/traitsui/wx/tabular_editor.py @@ -937,7 +937,7 @@ def save_prefs(self): """ cws = self._cached_widths if cws is not None: - cws = [(None, cw)[cw >= 0] for cw in cws] + cws = [cw if cw is not None and cw >= 0 else None for cw in cws] return {"cached_widths": cws}