1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-25 17:09:02 +00:00

Hash Port objects by port spec, fixing breakage

This commit is contained in:
dmiller
2019-12-30 06:46:35 +00:00
parent 3e58be1551
commit 74708c3e3a

View File

@@ -324,7 +324,8 @@ class Port(object):
def spec_string(self):
return u"%d/%s" % self.spec
__hash__ = None
def __hash__(self):
return hash(self.spec)
def __cmp__(self, other):
d = cmp(self.spec, other.spec)