fix: Fix python2.7 support.

pull/160/head
Raphaël Vinot 2017-12-20 14:21:32 +01:00
parent 78c156bb6f
commit 994afea0bd
1 changed files with 1 additions and 2 deletions

View File

@ -72,8 +72,7 @@ def _datetime_to_timestamp(d):
if sys.version_info >= (3, 3):
return d.timestamp()
else:
from datetime import timezone # Only for Python < 3.3
return (d - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()
return (d - datetime.utcfromtimestamp(0)).total_seconds()
class MISPAttribute(AbstractMISP):