Fix #5864 (Python string exceptions no more allowed in Python 2.6)

This commit is contained in:
Kovid Goyal 2010-06-17 16:44:13 -06:00
parent 80c85b7483
commit 57232edb2d

View File

@ -596,10 +596,11 @@ class DNSIncoming(object):
next = off + 1
off = ((len & 0x3F) << 8) | ord(self.data[off])
if off >= first:
raise 'Bad domain name (circular) at ' + str(off)
raise ValueError('Bad domain name (circular) at ' +
str(off))
first = off
else:
raise 'Bad domain name at ' + str(off)
raise ValueError('Bad domain name at ' + str(off))
if next >= 0:
self.offset = next