Fix Python2 bug when filter value is unicode

stix2.0
Chris Lenk 2017-11-15 16:56:55 -05:00
parent 1b816c3d84
commit 86f28644f9
1 changed files with 5 additions and 0 deletions

View File

@ -10,6 +10,11 @@ FILTER_OPS = ['=', '!=', 'in', '>', '<', '>=', '<=']
"""Supported filter value types"""
FILTER_VALUE_TYPES = [bool, dict, float, int, list, str, tuple]
try:
FILTER_VALUE_TYPES.append(unicode)
except NameError:
# Python 3 doesn't need to worry about unicode
pass
def _check_filter_components(prop, op, value):