From: Zac Medico Date: Sat, 30 Dec 2006 21:14:55 +0000 (-0000) Subject: Use a try/finally block to ensure that the alarm will always be cancelled appropriately. X-Git-Tag: v2.1.2~183 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cac3e113678f215fcf66592ea45a743580cb7984;p=portage.git Use a try/finally block to ensure that the alarm will always be cancelled appropriately. svn path=/main/trunk/; revision=5431 --- diff --git a/pym/portage.py b/pym/portage.py index 2942bb257..f127b788c 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -513,8 +513,10 @@ def elog_process(cpv, mysettings): # Timeout after one minute (in case something like the mail # module gets hung). signal.alarm(60) - m.process(mysettings, cpv, mylogentries, fulllog) - signal.alarm(0) + try: + m.process(mysettings, cpv, mylogentries, fulllog) + finally: + signal.alarm(0) if hasattr(m, "finalize") and not m.finalize in _elog_atexit_handlers: _elog_atexit_handlers.append(m.finalize) atexit_register(m.finalize, mysettings)