MCPcopy Index your code
hub / github.com/STIXProject/python-stix / check_version

Function check_version

stix/utils/__init__.py:228–241  ·  view source on GitHub ↗

Raises ValueError if `found` is not equal to or found within `expected`.

(expected, found)

Source from the content-addressed store, hash-verified

226
227
228def check_version(expected, found):
229 """Raises ValueError if `found` is not equal to or found within
230 `expected`.
231
232 """
233 if is_sequence(expected):
234 is_good = found in expected
235 else:
236 is_good = (found == expected)
237
238 if not is_good:
239 error = "Version '{0}' is invalid. Expected {1}."
240 error = error.format(found, expected)
241 raise ValueError(error)
242
243
244def iter_vars(obj):

Callers

nothing calls this directly

Calls 1

is_sequenceFunction · 0.85

Tested by

no test coverage detected