zeroconf: suppress traceback during shutdown stable
authorBrendan Cully <brendan@kublai.com>
Fri, 19 Feb 2010 16:50:47 -0800
branchstable
changeset 10514 1426b4807fc8
parent 10513 47838dee7d60
child 10515 98bc3e195720
zeroconf: suppress traceback during shutdown If the read thred is in select when the main thread is in close, the main thread may close the socket between select and read, generating a noisy traceback. This can be ignored if the shutdown flag is set.
hgext/zeroconf/Zeroconf.py
--- a/hgext/zeroconf/Zeroconf.py	Fri Feb 19 21:48:09 2010 +0100
+++ b/hgext/zeroconf/Zeroconf.py	Fri Feb 19 16:50:47 2010 -0800
@@ -863,7 +863,8 @@
 						try:
 							self.readers[socket].handle_read()
 						except:
-							traceback.print_exc()
+							if not globals()['_GLOBAL_DONE']:
+								traceback.print_exc()
 				except:
 					pass