]> git.phdru.name Git - dotfiles.git/commitdiff
init.py: Fix flake8 warnings
authorOleg Broytman <phd@phdru.name>
Mon, 22 Apr 2019 19:34:40 +0000 (22:34 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 22 Apr 2019 19:34:40 +0000 (22:34 +0300)
lib/python/init.py

index a6c2388cb9824bbd070e73692dc6d88d17ed55d8..71526b9198f4a4e8d1ce5d44b9860b0abaa899f2 100644 (file)
@@ -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