Skip to content

Commit

Permalink
Check for long in python 2 as well
Browse files Browse the repository at this point in the history
Fixes #1220
  • Loading branch information
honzakral committed Jul 22, 2019
1 parent 85dafe6 commit 9da2dcf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions elasticsearch_dsl/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from datetime import date, datetime

from dateutil import parser, tz
from six import string_types, iteritems
from six import string_types, iteritems, integer_types
from six.moves import map

from .query import Q
Expand Down Expand Up @@ -251,7 +251,7 @@ def _deserialize(self, data):
return data
if isinstance(data, date):
return data
if isinstance(data, int):
if isinstance(data, integer_types):
# Divide by a float to preserve milliseconds on the datetime.
return datetime.utcfromtimestamp(data / 1000.0)

Expand Down

0 comments on commit 9da2dcf

Please sign in to comment.