hgext/zeroconf/Zeroconf.py
changeset 8131 b0d945b95105
parent 7877 eba7f12b0c51
child 10288 e0121ad90b57
--- a/hgext/zeroconf/Zeroconf.py	Thu Apr 23 15:39:54 2009 -0500
+++ b/hgext/zeroconf/Zeroconf.py	Mon Apr 13 21:23:52 2009 +0300
@@ -259,7 +259,7 @@
 
 	def __init__(self, name, type, clazz):
 		if not name.endswith(".local."):
-			raise NonLocalNameException
+			raise NonLocalNameException(name)
 		DNSEntry.__init__(self, name, type, clazz)
 
 	def answeredBy(self, rec):
@@ -492,8 +492,11 @@
 			info = struct.unpack(format, self.data[self.offset:self.offset+length])
 			self.offset += length
 
-			question = DNSQuestion(name, info[0], info[1])
-			self.questions.append(question)
+			try:
+				question = DNSQuestion(name, info[0], info[1])
+				self.questions.append(question)
+			except NonLocalNameException:
+				pass
 
 	def readInt(self):
 		"""Reads an integer from the packet"""