basestring not supported in python 3.8

This commit is contained in:
Keyrun Adhikari 2021-09-30 14:01:06 -04:00 committed by Tom Hubrecht
parent d0653d4807
commit 387139f945
Signed by: thubrecht
SSH key fingerprint: SHA256:r+nK/SIcWlJ0zFZJGHtlAoRwq1Rm+WcKAm5ADYMoQPc

View file

@ -127,6 +127,10 @@ def validate(ticket):
attributes = xml_from_dict.get("cas:attributes", {})
if attributes and "cas:memberOf" in attributes:
try:
basestring
except NameError:
basestring = str
if isinstance(attributes["cas:memberOf"], basestring):
attributes["cas:memberOf"] = attributes["cas:memberOf"].lstrip('[').rstrip(']').split(',')
for group_number in range(0, len(attributes['cas:memberOf'])):