summaryrefslogtreecommitdiff
path: root/src/saml2/saml.py
diff options
context:
space:
mode:
authorColleen Murphy <colleen.murphy@suse.de>2018-08-15 15:41:20 +0200
committerColleen Murphy <colleen.murphy@suse.de>2018-08-15 15:41:20 +0200
commite58e89526da18f9e0ab9d67d17a2766f3941e1ea (patch)
tree8e4ef679de4aa5737d8884dce58acd65b7a6d050 /src/saml2/saml.py
parenta17f233c7a845105913ee4c72c33eb6c60a6d5c6 (diff)
downloadpysaml2-e58e89526da18f9e0ab9d67d17a2766f3941e1ea.tar.gz
Raise ValueError for invalid attribute type
Without this patch, the AttributeValueBase set_text method checks for a valid xsi:type before setting the text value, but when it gets to the catchall case, instead of raising an exception it simply creates an unassigned ValueError instance and does nothing with it. This is clearly not intentional, and it is a problem because it means it is possible to set an invalid xsi:type for an AttributeValue. This patch corrects the error by raising the ValueError exception rather than letting it disappear into the ether.
Diffstat (limited to 'src/saml2/saml.py')
-rw-r--r--src/saml2/saml.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/saml2/saml.py b/src/saml2/saml.py
index 7aefd408..8807966c 100644
--- a/src/saml2/saml.py
+++ b/src/saml2/saml.py
@@ -224,7 +224,7 @@ class AttributeValueBase(SamlBase):
elif typ == "xs:base64Binary":
pass
else:
- ValueError("Type and value doesn't match")
+ raise ValueError("Type and value doesn't match")
elif isinstance(val, bool):
if val:
val = "true"