Explorar el Código

cache: Treat EOFError as a negative _confirm answer

Jonas Borgström hace 10 años
padre
commit
848666e7cb
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      attic/cache.py

+ 4 - 1
attic/cache.py

@@ -70,7 +70,10 @@ class Cache(object):
             return True
         if sys.stdin.isatty():
             return False
-        answer = input('Do you want to continue? [yN] ')
+        try:
+            answer = input('Do you want to continue? [yN] ')
+        except EOFError:
+            return False
         return answer and answer in 'Yy'
 
     def create(self):