From: Oleg Broytman Date: Mon, 22 Apr 2019 19:34:40 +0000 (+0300) Subject: init.py: Fix flake8 warnings X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=02382ef710f05b6939bdc54b9b1ab7ef248dc104;p=dotfiles.git init.py: Fix flake8 warnings --- diff --git a/lib/python/init.py b/lib/python/init.py index a6c2388..71526b9 100644 --- a/lib/python/init.py +++ b/lib/python/init.py @@ -36,16 +36,15 @@ def init(): or os.path.expanduser('~/.inputrc') readline.read_init_file(initfile) - #if 'libedit' in readline.__doc__: - # readline.parse_and_bind("bind ^I rl_complete") - #else: - # readline.parse_and_bind("tab: complete") - histfile = os.path.expanduser('~/.python_history') try: readline.read_history_file(histfile) except IOError: pass # No such file + # if 'libedit' in readline.__doc__: + # readline.parse_and_bind("bind ^I rl_complete") + # else: + # readline.parse_and_bind("tab: complete") def savehist(): histsize = os.environ.get('HISTSIZE') @@ -127,7 +126,7 @@ def init(): try: builtins.raw_input - except AttributeError: # PY3 + except AttributeError: # PY3 builtin_input = builtins.input builtins.input = myinput else: @@ -195,7 +194,7 @@ def init(): pager = Pager() try: pager.pprint(value) - except: + except: # noqa pager.stdout = ColoredFile(pager.stdout, '\033[31m') # red print_exc(file=pager) pager.close() @@ -212,13 +211,13 @@ def init(): sys.excepthook = excepthook - #try: - # import cgitb - #except ImportError: - # pass - #else: - # # cgitb.enable() overrides sys.excepthook - # cgitb.enable(format='text') + # try: + # import cgitb + # except ImportError: + # pass + # else: + # # cgitb.enable() overrides sys.excepthook + # cgitb.enable(format='text') # From Thomas Heller: # https://mail.python.org/pipermail/python-list/2001-April/099020.html