]> git.phdru.name Git - dotfiles.git/commitdiff
init.py: Catch EOFError in myinput()
authorOleg Broytman <phd@phdru.name>
Fri, 29 Sep 2017 13:14:48 +0000 (16:14 +0300)
committerOleg Broytman <phd@phdru.name>
Fri, 29 Sep 2017 13:14:48 +0000 (16:14 +0300)
lib/python/init.py

index d8b7c79b89ab8bead28dc330db52457019576765..ff42ce40c845dbcbd0d94c8dbf4cf96763aeedd5 100644 (file)
@@ -115,7 +115,10 @@ def init():
         def myinput(prompt=None):
             save_stdout = sys.stdout
             sys.stdout = sys.__stdout__
-            result = builtin_input(prompt)
+            try:
+                result = builtin_input(prompt)
+            except EOFError:
+                result = None
             sys.stdout = save_stdout
             return result