From 2ca7c7acd3f47dc7da07fd8ad77df8c0c6c84735 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 3 Sep 2009 15:01:01 +0200 Subject: * apt/progress/__init__.py: - catch exceptions in pm.DoInstall() --- apt/progress/__init__.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'apt/progress') 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() -- cgit v1.2.3