diff --git a/stix2/custom.py b/stix2/custom.py index 0db9d25..802fd07 100644 --- a/stix2/custom.py +++ b/stix2/custom.py @@ -54,6 +54,9 @@ def _custom_marking_builder(cls, type, properties, version): def _custom_observable_builder(cls, type, properties, version, id_contrib_props=None): + if id_contrib_props is None: + id_contrib_props = [] + class _CustomObservable(cls, _Observable): if not re.match(TYPE_REGEX, type): diff --git a/stix2/v21/observables.py b/stix2/v21/observables.py index 88d2f6c..e8c1925 100644 --- a/stix2/v21/observables.py +++ b/stix2/v21/observables.py @@ -980,9 +980,6 @@ def CustomObservable(type='x-custom-observable', properties=None, id_contrib_pro ... pass """ - if id_contrib_props is None: - id_contrib_props = [] - def wrapper(cls): _properties = list(itertools.chain.from_iterable([ [('type', TypeProperty(type))],