diff options
author | Clint Byrum <clint@fewbar.com> | 2015-05-15 10:52:33 -0700 |
---|---|---|
committer | Clint Byrum <clint@fewbar.com> | 2015-05-15 11:52:15 -0700 |
commit | 99911f6c4c7d51071f70709e55fabcd2e6853284 (patch) | |
tree | 9ae82d0d6c11e05bd9bd152c94993d21f744b252 /src/saml2/validate.py | |
parent | 4ef44631df5426e0b4808b1c79b51a37eb026a76 (diff) | |
download | pysaml2-99911f6c4c7d51071f70709e55fabcd2e6853284.tar.gz |
Fix python3 syntax errors
Retains python2.7 compatibility for all files. Fixes only syntax errors,
tests still fail on python3 for various reasons.
Diffstat (limited to 'src/saml2/validate.py')
-rw-r--r-- | src/saml2/validate.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/saml2/validate.py b/src/saml2/validate.py index 2fd7040e..01e7b050 100644 --- a/src/saml2/validate.py +++ b/src/saml2/validate.py @@ -337,10 +337,10 @@ def valid(typ, value): def _valid_instance(instance, val): try: val.verify() - except NotValid, exc: + except NotValid as exc: raise NotValid("Class '%s' instance: %s" % ( instance.__class__.__name__, exc.args[0])) - except OutsideCardinality, exc: + except OutsideCardinality as exc: raise NotValid( "Class '%s' instance cardinality error: %s" % ( instance.__class__.__name__, exc.args[0])) @@ -361,7 +361,7 @@ def valid_instance(instance): try: validate_value_type(instance.text.strip(), instclass.c_value_type) - except NotValid, exc: + except NotValid as exc: raise NotValid("Class '%s' instance: %s" % (class_name, exc.args[0])) @@ -382,7 +382,7 @@ def valid_instance(instance): validate_value_type(value, spec) else: valid(typ, value) - except (NotValid, ValueError), exc: + except (NotValid, ValueError) as exc: txt = ERROR_TEXT % (value, name, exc.args[0]) raise NotValid("Class '%s' instance: %s" % (class_name, txt)) @@ -449,4 +449,4 @@ def valid_domain_name(dns_name): "^[a-z0-9]+([-.]{ 1 }[a-z0-9]+).[a-z]{2,5}(:[0-9]{1,5})?(\/.)?$", dns_name, "ix") if not m: - raise ValueError("Not a proper domain name")
\ No newline at end of file + raise ValueError("Not a proper domain name") |