diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2009-12-02 16:48:32 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2009-12-02 16:48:32 +0100 |
| commit | c197bef880cf57d4c4257c5053d993f896f697f8 (patch) | |
| tree | 61a4041791d5dc0cfab544e5644c40bb3e70dab8 /apt | |
| parent | 18e9800bb962072e79e99f8fb1a29692919596ee (diff) | |
| download | python-apt-c197bef880cf57d4c4257c5053d993f896f697f8.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')
| -rw-r--r-- | apt/progress/__init__.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apt/progress/__init__.py b/apt/progress/__init__.py index 8a9eb86f..8694de77 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: |
