summaryrefslogtreecommitdiff
path: root/apt/progress/__init__.py
diff options
context:
space:
mode:
authorColin Watson <cjwatson@canonical.com>2009-12-02 15:14:22 +0000
committerColin Watson <cjwatson@canonical.com>2009-12-02 15:14:22 +0000
commitc69e1b0d6e7224f21026c2ec793140b99b93f8de (patch)
tree4563b1383065f0ed875b41af4c6498e87ebe2f8b /apt/progress/__init__.py
parent78e5a19a66ece4150cad2edd9010e1721db4cc6d (diff)
downloadpython-apt-c69e1b0d6e7224f21026c2ec793140b99b93f8de.tar.gz
* apt/progress/__init__.py:
- Fix InstallProgress.updateInterface() to cope with read() returning 0 on non-blocking file descriptors (LP: #491027).
Diffstat (limited to 'apt/progress/__init__.py')
-rw-r--r--apt/progress/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/apt/progress/__init__.py b/apt/progress/__init__.py
index ca60810f..c042ece7 100644
--- a/apt/progress/__init__.py
+++ b/apt/progress/__init__.py
@@ -246,7 +246,10 @@ class InstallProgress(DumbInstallProgress):
return
try:
while not self.read.endswith("\n"):
- self.read += os.read(self.statusfd.fileno(), 1)
+ r = os.read(self.statusfd.fileno(), 1)
+ if not r:
+ return
+ self.read += r
except OSError, (errno_, errstr):
# resource temporarly unavailable is ignored
if errno_ != errno.EAGAIN and errno_ != errno.EWOULDBLOCK: