Zeroconf: catch both ValueError and KeyError in get()
authorAugie Fackler <durin42@gmail.com>
Sat, 30 Apr 2011 07:30:38 -0500
changeset 14063 87ebf72878ed
parent 14062 643381286e0c
child 14064 e4bfb9c337f3
Zeroconf: catch both ValueError and KeyError in get() This prevents a traceback during discovery of available hosts.
hgext/zeroconf/Zeroconf.py
--- a/hgext/zeroconf/Zeroconf.py	Sat Apr 30 15:20:27 2011 +0300
+++ b/hgext/zeroconf/Zeroconf.py	Sat Apr 30 07:30:38 2011 -0500
@@ -808,7 +808,7 @@
 		try:
 			list = self.cache[entry.key]
 			return list[list.index(entry)]
-		except KeyError:
+		except (KeyError, ValueError):
 			return None
 
 	def getByDetails(self, name, type, clazz):