]> git.decadent.org.uk Git - dak.git/commitdiff
Handle broken pipe while waiting for action
authorLuca Falavigna <dktrkranz@ries.debian.org>
Tue, 24 Nov 2009 07:36:27 +0000 (07:36 +0000)
committerLuca Falavigna <dktrkranz@ries.debian.org>
Tue, 24 Nov 2009 07:36:27 +0000 (07:36 +0000)
our_raw_input waits for action, but an exception is raised if user
does not provide it. Loop until a correct action is taken, this way
dak does not horribly crash each time.

Signed-off-by: Luca Falavigna <dktrkranz@debian.org>
daklib/utils.py

index 3cc4053861896fa5023780d5b484bab61d6eab40..cfbf8aa00199f22a3f333e1410c7847d18c145d8 100644 (file)
@@ -115,7 +115,12 @@ def open_file(filename, mode='r'):
 
 def our_raw_input(prompt=""):
     if prompt:
-        sys.stdout.write(prompt)
+        while 1:
+            try:
+                sys.stdout.write(prompt)
+                break
+            except IOError:
+                pass
     sys.stdout.flush()
     try:
         ret = raw_input()