summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Hellmann <doug.hellmann@dreamhost.com>2012-11-28 06:22:50 -0500
committerDoug Hellmann <doug.hellmann@dreamhost.com>2012-11-28 06:22:50 -0500
commite7259f89ad7e2e199c4f6709265349b9c5ab215d (patch)
treebdac0f2f72d365ee307baa55705f3c96f280a6d8
parent13d4b5697040d114eaeaab50da7eb4a6be2a0d42 (diff)
downloadstevedore-e7259f89ad7e2e199c4f6709265349b9c5ab215d.tar.gz
fix logging support under python 2.6
Change-Id: I2badb7a5a8f8f2c49eb29ced5ce2e6c745f20af1 Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
-rw-r--r--stevedore/__init__.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/stevedore/__init__.py b/stevedore/__init__.py
index f61f605..bc5960b 100644
--- a/stevedore/__init__.py
+++ b/stevedore/__init__.py
@@ -8,4 +8,9 @@ import logging
# Configure a NullHandler for our log messages in case
# the app we're used from does not set up logging.
-logging.getLogger(__name__).addHandler(logging.NullHandler())
+LOG = logging.getLogger(__name__)
+try:
+ LOG.addHandler(logging.NullHandler())
+except AttributeError:
+ # No NullHandler, probably python 2.6
+ pass