finally: del repo send_pm(user, _('Finished build cache for component %(component)s.') % {'component': component.name}) if component.potlocation: repo = POTUpdater(project, release, component, logfile) try: repo.build() if new_team: potfiles = POTFile.objects.filter(release=release, component=component) for potfile in potfiles: repo.add_pofiles(potfile) except lock.LockException, l: repo.notify_callback(l) logger.error(l) send_pm(user, _("Project locked"), message=_('Project %s locked. Try again in a few minutes. If the problem persist contact the administrator.') % project.name) except Exception, e: repo.notify_callback(e) logger.error(e) send_pm(user, _("Build error"), message=_('Build error. Reason: %(error)s') % { 'error': e.args}) finally: del repo except Exception, e: logger.error(e)