From 14bc9e4b19199b695c84e97a5baa7ea64bbfd6a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Thu, 26 Oct 2017 12:05:51 -0400 Subject: [PATCH] fix: Properly pop the distribution key. --- pymisp/mispevent.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pymisp/mispevent.py b/pymisp/mispevent.py index f00c5cf..3f99d7a 100644 --- a/pymisp/mispevent.py +++ b/pymisp/mispevent.py @@ -177,8 +177,9 @@ class MISPAttribute(AbstractMISP): 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))