Skip to content

Commit

Permalink
(fix) python3 set requires custom hash
Browse files Browse the repository at this point in the history
Signed-off-by: Ning Sun <sunng@about.me>
  • Loading branch information
sunng87 committed Oct 15, 2016
1 parent c92b655 commit 4ba7327
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions jip/maven.py
Expand Up @@ -67,6 +67,12 @@ def __str__(self):
def __repr__(self):
return self.__str__()

def __hash__(self):
if hasattr(self, 'group') and hasattr(self, 'artifact') and hasattr(self, 'version'):
return self.group.__hash__()*13+self.artifact.__hash__()*7+self.version.__hash__()
else:
return 0

def is_snapshot(self):
return self.version.find('SNAPSHOT') > 0

Expand Down

0 comments on commit 4ba7327

Please sign in to comment.