Quellcode durchsuchen

cache: Treat EOFError as a negative _confirm answer

Jonas Borgström vor 10 Jahren
Ursprung
Commit
848666e7cb
1 geänderte Dateien mit 4 neuen und 1 gelöschten Zeilen
  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):