From b4700e6d00d1c46e91bede4b6e1cf128334d8369 Mon Sep 17 00:00:00 2001 From: Chris Lenk Date: Fri, 27 Mar 2020 06:33:29 -0400 Subject: [PATCH] Fix import errors And pin medallion version for testing. --- stix2/utils.py | 6 ++---- tox.ini | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/stix2/utils.py b/stix2/utils.py index da04a3e..69489d9 100644 --- a/stix2/utils.py +++ b/stix2/utils.py @@ -12,7 +12,7 @@ import re from dateutil import parser import pytz -import stix2.base +import stix2 from .exceptions import ( InvalidValueError, RevokeError, UnmodifiablePropertyError, @@ -233,14 +233,12 @@ def find_property_index(obj, search_key, search_value): Returns: int: An index; -1 if the key and value aren't found """ - from .base import _STIXBase - # Special-case keys which are numbers-as-strings, e.g. for cyber-observable # mappings. Use the int value of the key as the index. if search_key.isdigit(): return int(search_key) - if isinstance(obj, _STIXBase): + if isinstance(obj, stix2.base._STIXBase): if search_key in obj and obj[search_key] == search_value: idx = _find(obj.object_properties(), search_key) else: diff --git a/tox.ini b/tox.ini index d34aac1..38ecb61 100644 --- a/tox.ini +++ b/tox.ini @@ -12,7 +12,7 @@ deps = fuzzywuzzy haversine python-Levenshtein - medallion + medallion<2.0.0 commands = python -m pytest --cov=stix2 stix2/test/ --cov-report term-missing -W ignore::stix2.exceptions.STIXDeprecationWarning