Skip to content

Commit

Permalink
Fix hasattr on Payload
Browse files Browse the repository at this point in the history
__hasattr__ isn't a thing. hasattr calls getattr and looks for an AttributeError.
  • Loading branch information
illicitonion committed Mar 25, 2019
1 parent b963e89 commit 56f2a3b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/python/pants/base/payload.py
Expand Up @@ -145,11 +145,11 @@ def mark_dirty(self):
field.mark_dirty()

def __getattr__(self, attr):
field = self._fields[attr]
try:
field = self._fields[attr]
except KeyError:
raise AttributeError(attr)
if field is not None:
return field.value
else:
return None

def __hasattr__(self, attr):
return attr in self._fields

0 comments on commit 56f2a3b

Please sign in to comment.