Xqt has submitted this change and it was merged.
Change subject: Bug 55663 - AttributeError: 'module' object has no attribute 'NullHandler' ......................................................................
Bug 55663 - AttributeError: 'module' object has no attribute 'NullHandler'
Change-Id: If5530756135827d4c3874f00dfd0740326930783 --- M wikipedia.py 1 file changed, 18 insertions(+), 1 deletion(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/wikipedia.py b/wikipedia.py index 1b27881..052b610 100644 --- a/wikipedia.py +++ b/wikipedia.py @@ -9119,6 +9119,23 @@ logger = None #_handlers_initialized = False
+ +class NullHandler(logging.Handler): + """ + For backward-compatibility with Python 2.6, a local class definition + is used instead of logging.NullHandler + """ + + def handle(self, record): + pass + + def emit(self, record): + pass + + def createLock(self): + self.lock = None + + def setLogfileStatus(enabled, logname=None, header=False): # NOTE-1: disable 'fh.setFormatter(formatter)' below in order to get "old" # logging format (without additional info) @@ -9233,7 +9250,7 @@
logger = logging.getLogger() # root logger
- nh = logging.NullHandler() + nh = NullHandler() logger.addHandler(nh) logger.setLevel(DEBUG+1)