summaryrefslogtreecommitdiff
path: root/apt
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2009-09-03 15:01:01 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2009-09-03 15:01:01 +0200
commit2ca7c7acd3f47dc7da07fd8ad77df8c0c6c84735 (patch)
treea1f37bfc5374d51cf54536099f7c8f5f021a1fc3 /apt
parent0d4a8172a7bceac5bdca37cc199d9bfba889cc4f (diff)
downloadpython-apt-2ca7c7acd3f47dc7da07fd8ad77df8c0c6c84735.tar.gz
* apt/progress/__init__.py:
- catch exceptions in pm.DoInstall()
Diffstat (limited to 'apt')
-rw-r--r--apt/progress/__init__.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/apt/progress/__init__.py b/apt/progress/__init__.py
index 3a6b3f91..97090643 100644
--- a/apt/progress/__init__.py
+++ b/apt/progress/__init__.py
@@ -311,8 +311,15 @@ class InstallProgress(DumbInstallProgress):
"""Start installing."""
pid = self.fork()
if pid == 0:
- # child
- res = pm.DoInstall(self.writefd)
+ # pm.DoInstall might raise a exception,
+ # when this happens, we need to catch
+ # it, otherwise os._exit() is not run
+ # and the execution continues in the
+ # parent code leading to very confusing bugs
+ try:
+ res = pm.DoInstall(self.writefd)
+ except Exception, e:
+ os._exit(pm.ResultFailed)
os._exit(res)
self.child_pid = pid
res = self.waitChild()