From 541b35270fdd50798ff1d6f5fc6695444dac776d Mon Sep 17 00:00:00 2001 From: holger krekel Date: Sun, 10 May 2009 21:36:13 +0200 Subject: [PATCH] care for threading module being set to None already during finalization --HG-- branch : trunk --- py/execnet/gateway.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py/execnet/gateway.py b/py/execnet/gateway.py index 57c089683..6a23c0d24 100644 --- a/py/execnet/gateway.py +++ b/py/execnet/gateway.py @@ -167,7 +167,8 @@ class Gateway(object): except IOError: self._trace('IOError on _stopsend()') self._channelfactory._finished_receiving() - self._trace('leaving %r' % threading.currentThread()) + if threading: # might be None during shutdown/finalization + self._trace('leaving %r' % threading.currentThread()) from sys import exc_info def _send(self, msg):