From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id AD0B413888F for ; Sun, 11 Oct 2015 17:26:55 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4D315E085D; Sun, 11 Oct 2015 17:26:43 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 20D9DE085D for ; Sun, 11 Oct 2015 17:26:42 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5099833FD3F for ; Sun, 11 Oct 2015 17:26:41 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 136AFDFC for ; Sun, 11 Oct 2015 17:26:38 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1444542985.988f43379698cd76e8883a6bfffff0506a1b128d.vapier@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/base/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/base/resume.py X-VCS-Directories: catalyst/base/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 988f43379698cd76e8883a6bfffff0506a1b128d X-VCS-Branch: master Date: Sun, 11 Oct 2015 17:26:38 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: a642a67f-6dd6-49e5-a5cb-960e295a7cbc X-Archives-Hash: 9445df10e96911d5e4cc61a0c032e414 commit: 988f43379698cd76e8883a6bfffff0506a1b128d Author: Mike Frysinger gentoo org> AuthorDate: Sat Oct 10 05:59:09 2015 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Sun Oct 11 05:56:25 2015 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=988f4337 resume: convert to log module The AutoResumeError exception wasn't actually used as an exception -- it was never raised, only printed. Throw it away in place of a plain log message. catalyst/base/resume.py | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/catalyst/base/resume.py b/catalyst/base/resume.py index 443b46d..99d8abc 100644 --- a/catalyst/base/resume.py +++ b/catalyst/base/resume.py @@ -12,27 +12,13 @@ set, unset, is_set, is_unset, enabled, clear_all ''' import os -import sys -import traceback from snakeoil import fileutils +from catalyst import log from catalyst.fileops import ensure_dirs, pjoin, listdir_files, clear_dir -class AutoResumeError(Exception): - def __init__(self, message, print_traceback=False): - if message: - if print_traceback: - (_type, value) = sys.exc_info()[:2] - if value!=None: - print - print "Traceback values found. listing..." - print traceback.print_exc(file=sys.stdout) - print "!!! catalyst: AutoResumeError " + message - print - - class AutoResume(object): '''Class for tracking and handling all aspects of the autoresume option and related files. @@ -73,7 +59,7 @@ class AutoResume(object): fileutils.touch(fname) self._points[point] = fname except Exception as e: - print AutoResumeError(str(e)) + log.error('AutoResumeError: %s', e) return False return True @@ -91,7 +77,7 @@ class AutoResume(object): if data and no_lf: data = data.replace('\n', '') except OSError as e: - print AutoResumeError(str(e)) + log.error('AutoResumeError: %s', e) return None return data return None @@ -109,7 +95,7 @@ class AutoResume(object): os.unlink(self._points[point]) self._points.pop(point) except Exception as e: - print AutoResumeError(str(e)) + log.error('AutoResumeError: %s', e) return False return True