From cac3e113678f215fcf66592ea45a743580cb7984 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 30 Dec 2006 21:14:55 +0000 Subject: Use a try/finally block to ensure that the alarm will always be cancelled appropriately. svn path=/main/trunk/; revision=5431 --- pym/portage.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'pym') 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) -- cgit v1.2.3-1-g7c22