diff options
| author | Stephan Peijnik <debian@sp.or.at> | 2009-07-25 10:35:21 +0200 |
|---|---|---|
| committer | Stephan Peijnik <debian@sp.or.at> | 2009-07-25 10:35:21 +0200 |
| commit | 80bd612d4006a493541ca8f50b1634ee529cb533 (patch) | |
| tree | 8619008dda8b259b26506fc9b033bffbbd8bd549 /apt/progress | |
| parent | d28170024ef4d2f01fd9096a3ec785cf424c0846 (diff) | |
| download | python-apt-80bd612d4006a493541ca8f50b1634ee529cb533.tar.gz | |
Exception handling fixes in InstallProgress class.
Diffstat (limited to 'apt/progress')
| -rw-r--r-- | apt/progress/__init__.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/apt/progress/__init__.py b/apt/progress/__init__.py index 3be197f7..b582ad22 100644 --- a/apt/progress/__init__.py +++ b/apt/progress/__init__.py @@ -286,11 +286,20 @@ class InstallProgress(DumbInstallProgress): def waitChild(self): """Wait for child progress to exit.""" while True: - select.select([self.statusfd], [], [], self.selectTimeout) - self.updateInterface() - (pid, res) = os.waitpid(self.child_pid, os.WNOHANG) - if pid == self.child_pid: + try: + select.select([self.statusfd], [], [], self.selectTimeout) + except select.error, (errno_, errstr): + if errno_ != errno.EINTR: + raise break + self.updateInterface() + try: + (pid, res) = os.waitpid(self.child_pid, os.WNOHANG) + if pid == self.child_pid: + break + except OSError, (errno_, errstr): + if errno_ != errno.EINTR: + raise return res def run(self, pm): |
