File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 55
55
}
56
56
57
57
MDNS = '"urn:oasis:names:tc:SAML:2.0:metadata"'
58
+ bMDNS = b'"urn:oasis:names:tc:SAML:2.0:metadata"'
58
59
XMLNSXS = " xmlns:xs=\" http://www.w3.org/2001/XMLSchema\" "
59
-
60
+ bXMLNSXS = b" xmlns:xs= \" http://www.w3.org/2001/XMLSchema \" "
60
61
61
62
def metadata_tostring_fix (desc , nspair , xmlstring = "" ):
62
63
if not xmlstring :
63
64
xmlstring = desc .to_string (nspair )
64
- if "\" xs:string\" " in xmlstring and XMLNSXS not in xmlstring :
65
- xmlstring = xmlstring .replace (MDNS , MDNS + XMLNSXS )
65
+
66
+ if six .PY2 :
67
+ if "\" xs:string\" " in xmlstring and XMLNSXS not in xmlstring :
68
+ xmlstring = xmlstring .replace (MDNS , MDNS + XMLNSXS )
69
+ else :
70
+ if b"\" xs:string\" " in xmlstring and bXMLNSXS not in xmlstring :
71
+ xmlstring = xmlstring .replace (bMDNS , bMDNS + bXMLNSXS )
72
+
66
73
return xmlstring
67
74
68
75
You can’t perform that action at this time.
0 commit comments