mirror of https://github.com/MISP/PyMISP
fix: Fix python2.7 support.
parent
78c156bb6f
commit
994afea0bd
|
@ -72,8 +72,7 @@ def _datetime_to_timestamp(d):
|
||||||
if sys.version_info >= (3, 3):
|
if sys.version_info >= (3, 3):
|
||||||
return d.timestamp()
|
return d.timestamp()
|
||||||
else:
|
else:
|
||||||
from datetime import timezone # Only for Python < 3.3
|
return (d - datetime.utcfromtimestamp(0)).total_seconds()
|
||||||
return (d - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()
|
|
||||||
|
|
||||||
|
|
||||||
class MISPAttribute(AbstractMISP):
|
class MISPAttribute(AbstractMISP):
|
||||||
|
|
Loading…
Reference in New Issue