diff --git a/stix2/STIXPatternVisitor.py b/stix2/STIXPatternVisitor.py index 43be107..89b79da 100644 --- a/stix2/STIXPatternVisitor.py +++ b/stix2/STIXPatternVisitor.py @@ -3,20 +3,20 @@ import inspect import six from stix2patterns.grammars.STIXPatternLexer import STIXPatternLexer -from stix2patterns.grammars.STIXPatternParser import ( - STIXPatternParser, TerminalNode, -) +from stix2patterns.grammars.STIXPatternParser import (STIXPatternParser, + TerminalNode) from stix2patterns.grammars.STIXPatternVisitor import STIXPatternVisitor from stix2patterns.validator import STIXPatternErrorListener -from stix2.patterns import _BooleanExpression from antlr4 import CommonTokenStream, InputStream +from stix2.patterns import _BooleanExpression # need to import all classes because we need to access them via globals() +from .patterns import (BinaryConstant, BooleanConstant, FloatConstant, + FollowedByObservationExpression, HexConstant, + IntegerConstant, RepeatQualifier, StartStopQualifier, + StringConstant, TimestampConstant, WithinQualifier) from .patterns import * # noqa -from .patterns import (FollowedByObservationExpression, StartStopQualifier, WithinQualifier, - RepeatQualifier, StringConstant, IntegerConstant, FloatConstant, HexConstant, - BinaryConstant, BooleanConstant, TimestampConstant) def collapse_lists(lists): diff --git a/stix2/__init__.py b/stix2/__init__.py index 3d70001..449be68 100644 --- a/stix2/__init__.py +++ b/stix2/__init__.py @@ -54,7 +54,6 @@ from .utils import new_version, revoke from .v20 import * # This import will always be the latest STIX 2.X version from .version import __version__ - _collect_stix2_obj_maps() DEFAULT_VERSION = "2.0" # Default version will always be the latest STIX 2.X version diff --git a/stix2/patterns.py b/stix2/patterns.py index fec060e..1e0e03f 100644 --- a/stix2/patterns.py +++ b/stix2/patterns.py @@ -5,6 +5,7 @@ import base64 import binascii import datetime import re + import six from .utils import parse_into_datetime diff --git a/stix2/test/test_pattern_expressions.py b/stix2/test/test_pattern_expressions.py index c136eaa..0aff872 100644 --- a/stix2/test/test_pattern_expressions.py +++ b/stix2/test/test_pattern_expressions.py @@ -3,7 +3,6 @@ import datetime import pytest import stix2 - from stix2.STIXPatternVisitor import create_pattern_object