From 7720464b7f37d764f4d97e47ae5cc4ba6dbe353f Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 29 Mar 2018 21:42:29 +0300 Subject: [PATCH] init.py: Refactor loop over term types --- lib/python/init.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/python/init.py b/lib/python/init.py index ff42ce4..a6c2388 100644 --- a/lib/python/init.py +++ b/lib/python/init.py @@ -77,10 +77,13 @@ def init(): # From Randall Hopper: # https://mail.python.org/pipermail/python-list/2001-March/112696.html + _term_found = False for _term in ['linux', 'rxvt', 'screen', 'term', 'vt100']: - if _term not in term: - continue + if _term in term: + _term_found = True + break + if _term_found: if background == 'dark': ps1_color = '3' # yellow stdout_color = '7' # bold white @@ -131,8 +134,6 @@ def init(): builtin_input = builtins.raw_input builtins.raw_input = myinput - break - try: import locale except ImportError: -- 2.39.2