We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2335fc commit 1b97237Copy full SHA for 1b97237
src/saml2/saml.py
@@ -87,10 +87,6 @@
87
NS_SOAP_ENC = "http://schemas.xmlsoap.org/soap/encoding/"
88
89
90
-_b64_decode_fn = getattr(base64, 'decodebytes', base64.decodestring)
91
-_b64_encode_fn = getattr(base64, 'encodebytes', base64.encodestring)
92
-
93
94
class AttributeValueBase(SamlBase):
95
def __init__(self,
96
text=None,
@@ -232,10 +228,9 @@ def _wrong_type_value(xsd, value):
232
228
'base64Binary': {
233
229
'type': _str,
234
230
'to_type': _str,
235
- 'to_text': lambda x:
236
- _b64_encode_fn(x.encode())
237
- if base64encode
238
- else x,
231
+ 'to_text': (
+ lambda x: base64.encodebytes(x.encode()) if base64encode else x
+ ),
239
},
240
'anyType': {
241
'type': type(value),
0 commit comments