From dd6b847b10eed8604bed7c9d690ef47c86ff7098 Mon Sep 17 00:00:00 2001 From: Emmanuelle Vargas-Gonzalez Date: Wed, 31 Mar 2021 12:44:15 -0400 Subject: [PATCH] small tweaks and pre-commit changes --- stix2/base.py | 3 +-- stix2/properties.py | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/stix2/base.py b/stix2/base.py index 8a5a517..6f29882 100644 --- a/stix2/base.py +++ b/stix2/base.py @@ -22,7 +22,6 @@ from .utils import NOW, PREFIX_21_REGEX, get_timestamp from .versioning import new_version as _new_version from .versioning import revoke as _revoke - DEFAULT_ERROR = "{type} must have {property}='{expected}'." SCO_DET_ID_NAMESPACE = uuid.UUID("00abedb4-aa42-466c-9c01-fed23315a9b7") @@ -75,7 +74,7 @@ class _STIXBase(collections.abc.Mapping): def _check_at_least_one_property(self, list_of_properties=None): if not list_of_properties: - list_of_properties = sorted(list(self.__class__._properties.keys())) + list_of_properties = sorted(self.__class__._properties.keys()) if isinstance(self, _Observable): props_to_remove = {"type", "id", "defanged", "spec_version"} else: diff --git a/stix2/properties.py b/stix2/properties.py index 8fb8a75..1ec1311 100644 --- a/stix2/properties.py +++ b/stix2/properties.py @@ -17,7 +17,6 @@ from .exceptions import ( from .parsing import parse, parse_observable from .utils import _get_dict, get_class_hierarchy_names, parse_into_datetime - TYPE_REGEX = re.compile(r'^-?[a-z0-9]+(-[a-z0-9]+)*-?$') TYPE_21_REGEX = re.compile(r'^([a-z][a-z0-9]*)+([a-z0-9-]+)*-?$') ERROR_INVALID_ID = (