From c5ba5dad658bc2175a7d17cc1fc513e74c0d0d2b Mon Sep 17 00:00:00 2001 From: clenk Date: Tue, 25 Apr 2017 10:03:37 -0400 Subject: [PATCH] Modify UUID checking --- stix2/properties.py | 4 ++-- stix2/test/test_properties.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stix2/properties.py b/stix2/properties.py index ecdbf18..76fe31b 100644 --- a/stix2/properties.py +++ b/stix2/properties.py @@ -149,9 +149,9 @@ class IDProperty(Property): if not value.startswith(self.required_prefix): raise ValueError("must start with '{0}'.".format(self.required_prefix)) try: - uuid.UUID(value.split('--', 1)[1], version=4) + uuid.UUID(value.split('--', 1)[1]) except Exception: - raise ValueError("must have a valid version 4 UUID after the prefix.") + raise ValueError("must have a valid UUID after the prefix.") return value def default(self): diff --git a/stix2/test/test_properties.py b/stix2/test/test_properties.py index 06172ab..e83b2fc 100644 --- a/stix2/test/test_properties.py +++ b/stix2/test/test_properties.py @@ -86,7 +86,7 @@ def test_id_property(): assert str(excinfo.value) == "must start with 'my-type--'." with pytest.raises(ValueError) as excinfo: idprop.clean('my-type--foo') - assert str(excinfo.value) == "must have a valid version 4 UUID after the prefix." + assert str(excinfo.value) == "must have a valid UUID after the prefix." assert idprop.clean(idprop.default())