2
0
Эх сурвалжийг харах

cache: Treat EOFError as a negative _confirm answer

Jonas Borgström 10 жил өмнө
parent
commit
848666e7cb
1 өөрчлөгдсөн 4 нэмэгдсэн , 1 устгасан
  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):