Skip to content

Commit d42e57f

Browse files
committed
Fixes #693: Allow generation of signed metadata in python3
1 parent 8e0582a commit d42e57f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/saml2/metadata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ def metadata_tostring_fix(desc, nspair, xmlstring=""):
6666
if not xmlstring:
6767
xmlstring = desc.to_string(nspair)
6868

69-
if six.PY2:
69+
try:
7070
if "\"xs:string\"" in xmlstring and XMLNSXS not in xmlstring:
7171
xmlstring = xmlstring.replace(MDNS, MDNS + XMLNSXS)
72-
else:
72+
except TypeError:
7373
if b"\"xs:string\"" in xmlstring and bXMLNSXS not in xmlstring:
7474
xmlstring = xmlstring.replace(bMDNS, bMDNS + bXMLNSXS)
7575

0 commit comments

Comments
 (0)