beets.logging exports NullHandler on python 2.6

NullHandler is not available in python 2.6. We backport it so the
importer log can use it for it is more convenient than guarding calls to
self.logger (see beets/importer.py)
This commit is contained in:
Bruno Cauet 2015-01-13 09:20:29 +01:00
parent cce0a5d81f
commit 81754e5760

View file

@ -92,3 +92,16 @@ if PY26:
return logger
my_manager.getLogger = new_getLogger
# Offer NullHandler in Python 2.6 to reduce the difference with never versions
if PY26:
class NullHandler(Handler):
def handle(self, record):
pass
def emit(self, record):
pass
def createLock(self):
self.lock = None