Fix Python2 support

pull/34/head
Raphaël Vinot 2016-10-19 19:00:09 +02:00
parent 49433cdc3a
commit 0a63285efb
1 changed files with 1 additions and 1 deletions

View File

@ -254,7 +254,7 @@ class MISPEvent(object):
if kwargs.get('published') is not None:
self.publish()
if kwargs.get('date'):
if isinstance(kwargs['date'], basestring):
if isinstance(kwargs['date'], basestring) or isinstance(kwargs['date'], unicode):
self.date = parse(kwargs['date']).date()
elif isinstance(kwargs['date'], datetime.datetime):
self.date = kwargs['date'].date()