From 6f55c17f48d7608072199496fbcefa33f2e97bf0 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sun, 4 Jan 2015 15:39:28 +0100 Subject: Replaced ordered dict with standard version; used logging module All performance tests still print to stderr, but do so in a py3 compatible way --- git/config.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'git/config.py') diff --git a/git/config.py b/git/config.py index 51337db4..6a85760c 100644 --- a/git/config.py +++ b/git/config.py @@ -9,6 +9,7 @@ configuration files""" import re import ConfigParser as cp import inspect +import logging from git.odict import OrderedDict from git.util import LockFile @@ -16,6 +17,9 @@ from git.util import LockFile __all__ = ('GitConfigParser', 'SectionConstraint') +log = logging.getLogger('git.config') + + class MetaParserBuilder(type): """Utlity class wrapping base-class methods into decorators that assure read-only properties""" @@ -186,8 +190,8 @@ class GitConfigParser(cp.RawConfigParser, object): try: try: self.write() - except IOError as e: - print("Exception during destruction of GitConfigParser: %s" % str(e)) + except IOError: + log.error("Exception during destruction of GitConfigParser", exc_info=True) finally: self._lock._release_lock() -- cgit v1.2.1