Commit dbcc333d authored by Julien Muchembled's avatar Julien Muchembled

Merge "tests: fix LoggerThreadName class for recent Python"

parents e19f35e8 59b83c04
......@@ -333,19 +333,22 @@ class 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):
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