Skip to content

Commit 3095597

Browse files
committed
fix: use six.integer_types to handle int, long incompatibles
1 parent 965378f commit 3095597

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

schema_salad/validate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def validate_ex(expected_schema, # type: Schema
118118
else:
119119
return False
120120
elif schema_type == 'int':
121-
if ((isinstance(datum, int) or isinstance(datum, int))
121+
if (isinstance(datum, six.integer_types)
122122
and INT_MIN_VALUE <= datum <= INT_MAX_VALUE):
123123
return True
124124
else:
@@ -127,7 +127,7 @@ def validate_ex(expected_schema, # type: Schema
127127
else:
128128
return False
129129
elif schema_type == 'long':
130-
if ((isinstance(datum, int) or isinstance(datum, int))
130+
if ((isinstance(datum, six.integer_types))
131131
and LONG_MIN_VALUE <= datum <= LONG_MAX_VALUE):
132132
return True
133133
else:
@@ -137,7 +137,7 @@ def validate_ex(expected_schema, # type: Schema
137137
else:
138138
return False
139139
elif schema_type in ['float', 'double']:
140-
if (isinstance(datum, int) or isinstance(datum, int)
140+
if (isinstance(datum, six.integer_types)
141141
or isinstance(datum, float)):
142142
return True
143143
else:

0 commit comments

Comments
 (0)