Skip to content

Commit

Permalink
fix: Properly pop the distribution key.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Oct 26, 2017
1 parent 78eb6e3 commit 14bc9e4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pymisp/mispevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,9 @@ def from_dict(self, **kwargs):
if not isinstance(self.to_ids, bool):
raise NewAttributeError('{} is invalid, to_ids has to be True or False'.format(self.to_ids))

if kwargs.get('distribution') is not None:
self.distribution = int(kwargs.pop('distribution'))
self.distribution = kwargs.pop('distribution', None)
if self.distribution is not None:
self.distribution = int(self.distribution)
if self.distribution not in [0, 1, 2, 3, 4, 5]:
raise NewAttributeError('{} is invalid, the distribution has to be in 0, 1, 2, 3, 4, 5'.format(self.distribution))

Expand Down

0 comments on commit 14bc9e4

Please sign in to comment.