diff --git a/mitogen/core.py b/mitogen/core.py index 10336771..9bc11277 100644 --- a/mitogen/core.py +++ b/mitogen/core.py @@ -57,6 +57,11 @@ import imp # Absolute imports for <2.5. select = __import__('select') +try: + import thread +except ImportError: + import threading as thread + try: import cPickle as pickle except ImportError: @@ -1917,7 +1922,7 @@ class Latch(object): This disambiguates legitimate wake-ups, accidental writes to the FD, and buggy internal FD sharing. """ - ident = threading.currentThread().ident + ident = thread.get_ident() return b(u'%010d-%016x-%016x' % (os.getpid(), int(id(self)), ident)) COOKIE_SIZE = len(_make_cookie(None))