From 994afea0bd7c198aa1a7540e89293bf422ecfc72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Wed, 20 Dec 2017 14:21:32 +0100 Subject: [PATCH] fix: Fix python2.7 support. --- pymisp/mispevent.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pymisp/mispevent.py b/pymisp/mispevent.py index 387c5e0..3279cbe 100644 --- a/pymisp/mispevent.py +++ b/pymisp/mispevent.py @@ -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):