Skip to content

Commit 9da2dcf

Browse files
committed
Check for long in python 2 as well
Fixes #1220
1 parent 85dafe6 commit 9da2dcf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

elasticsearch_dsl/field.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from datetime import date, datetime
1010

1111
from dateutil import parser, tz
12-
from six import string_types, iteritems
12+
from six import string_types, iteritems, integer_types
1313
from six.moves import map
1414

1515
from .query import Q
@@ -251,7 +251,7 @@ def _deserialize(self, data):
251251
return data
252252
if isinstance(data, date):
253253
return data
254-
if isinstance(data, int):
254+
if isinstance(data, integer_types):
255255
# Divide by a float to preserve milliseconds on the datetime.
256256
return datetime.utcfromtimestamp(data / 1000.0)
257257

0 commit comments

Comments
 (0)