diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2015-02-17 12:51:34 +0200 |
---|---|---|
committer | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2015-02-17 12:56:42 +0200 |
commit | 4a6efd0a6276151f336b300235910e7443904efd (patch) | |
tree | 95b11362e66e9260ffb5ad2dfcdbdff25bda869c /gbp/log.py | |
parent | 933fa3d4a4aeb20f9ebbdde519f5cdebfdad92cd (diff) | |
download | git-buildpackage-4a6efd0a6276151f336b300235910e7443904efd.tar.gz git-buildpackage-4a6efd0a6276151f336b300235910e7443904efd.tar.bz2 git-buildpackage-4a6efd0a6276151f336b300235910e7443904efd.zip |
log: don't crash getLogger if getting the root logger
The root logger won't have the gbp-specific default_handlers attribute.
Change-Id: I0b81fdfbe70fe16ce3fd226248b83a4f6a17fc7f
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp/log.py')
-rw-r--r-- | gbp/log.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -176,7 +176,7 @@ def getLogger(*args, **kwargs): logging.setLoggerClass(GbpLogger) color = kwargs.pop('color') if 'color' in kwargs else 'auto' logger = logging.getLogger(*args, **kwargs) - if not logger.default_handlers: + if hasattr(logger, 'default_handlers') and not logger.default_handlers: logger.init_default_handlers(color) return logger |