diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2009-09-03 15:01:01 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2009-09-03 15:01:01 +0200 |
| commit | 2ca7c7acd3f47dc7da07fd8ad77df8c0c6c84735 (patch) | |
| tree | a1f37bfc5374d51cf54536099f7c8f5f021a1fc3 /apt | |
| parent | 0d4a8172a7bceac5bdca37cc199d9bfba889cc4f (diff) | |
| download | python-apt-2ca7c7acd3f47dc7da07fd8ad77df8c0c6c84735.tar.gz | |
* apt/progress/__init__.py:
- catch exceptions in pm.DoInstall()
Diffstat (limited to 'apt')
| -rw-r--r-- | apt/progress/__init__.py | 11 |
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() |
