summaryrefslogtreecommitdiff
path: root/apt
diff options
context:
space:
mode:
authorStephan Peijnik <debian@sp.or.at>2009-07-25 10:35:21 +0200
committerStephan Peijnik <debian@sp.or.at>2009-07-25 10:35:21 +0200
commit80bd612d4006a493541ca8f50b1634ee529cb533 (patch)
tree8619008dda8b259b26506fc9b033bffbbd8bd549 /apt
parentd28170024ef4d2f01fd9096a3ec785cf424c0846 (diff)
downloadpython-apt-80bd612d4006a493541ca8f50b1634ee529cb533.tar.gz
Exception handling fixes in InstallProgress class.
Diffstat (limited to 'apt')
-rw-r--r--apt/progress/__init__.py17
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):