Commit 59b83c04 authored by Julien Muchembled's avatar Julien Muchembled

tests: fix LoggerThreadName class for recent Python

See http://bugs.python.org/issue13361 ("getLogger does not check its argument").
parent b709cc89
......@@ -318,19 +318,22 @@ class NeoCTL(neo.neoctl.app.NeoCTL):
lambda self, address: setattr(self, '_server', address))
class LoggerThreadName(object):
class LoggerThreadName(str):
def __init__(self, default='TEST'):
self.__default = default
def __new__(cls, default='TEST'):
return str.__new__(cls, default)
def __getattr__(self, attr):
def __getattribute__(self, attr):
return getattr(str(self), attr)
def __hash__(self):
return id(self)
def __str__(self):
try:
return threading.currentThread().node_name
except AttributeError:
return self.__default
return str.__str__(self)
class Patch(object):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment