From d8490bc90adf795677d4d654f3cfafe171e4c243 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Wed, 23 Jan 2019 12:44:08 +0000 Subject: [PATCH] issue #477: 2.4.x compat fixes for mitogen.service. --- mitogen/service.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mitogen/service.py b/mitogen/service.py index 0d1ddb45..5f7b69da 100644 --- a/mitogen/service.py +++ b/mitogen/service.py @@ -40,6 +40,7 @@ import mitogen.core import mitogen.select from mitogen.core import b from mitogen.core import LOG +from mitogen.core import unicode__rpartition try: all @@ -201,7 +202,7 @@ class Activator(object): ) def activate(self, pool, service_name, msg): - mod_name, _, class_name = service_name.rpartition('.') + mod_name, _, class_name = unicode__rpartition(service_name, '.') if msg and not self.is_permitted(mod_name, class_name, msg): raise mitogen.core.CallError(self.not_active_msg, service_name) @@ -565,7 +566,7 @@ class Pool(object): self._worker_run() except Exception: th = threading.currentThread() - LOG.exception('%r: worker %r crashed', self, th.name) + LOG.exception('%r: worker %r crashed', self, th.getName()) raise def __repr__(self): @@ -573,7 +574,7 @@ class Pool(object): return 'mitogen.service.Pool(%#x, size=%d, th=%r)' % ( id(self), len(self._threads), - th.name, + th.getName(), )