diff --git a/stix2/properties.py b/stix2/properties.py index 424912ec..eef757be 100644 --- a/stix2/properties.py +++ b/stix2/properties.py @@ -504,7 +504,7 @@ def clean(self, value, allow_custom=False, strict=False): except CustomContentError: # Need to propagate these, not treat as a type error raise - except Exception as e: + except Exception: # clean failed; value must not conform to type_ # Should be a narrower exception type here, but I don't # know if it's safe to assume any particular exception diff --git a/stix2/test/v21/test_datastore_relational_db.py b/stix2/test/v21/test_datastore_relational_db.py index 78dd9f3d..0c2e3607 100644 --- a/stix2/test/v21/test_datastore_relational_db.py +++ b/stix2/test/v21/test_datastore_relational_db.py @@ -768,9 +768,7 @@ class Embedded(stix2.v21._STIXBase21): elif request.param == "dict-of": prop_variation = stix2.properties.DictionaryProperty( - # DictionaryProperty.valid_types does not accept property - # instances (except ListProperty instances), only classes... - valid_types=type(base_property) + valid_types=base_property ) # key name doesn't matter here prop_variation_value = {"key": prop_value}