2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-02-16 18:49:04 +00:00

Tolerate multiple forms of 'stringy'

The fromstring needs to accept either, so
amend it to do so.
This commit is contained in:
Jarrod Johnson 2021-01-22 12:43:15 -05:00
parent 8df15b3a54
commit 6458eac93b

View File

@ -30,7 +30,11 @@ getaddrinfo = eventlet.support.greendns.getaddrinfo
from xml.etree.ElementTree import fromstring as rfromstring
def fromstring(inputdata):
if '!entity' in inputdata.lower():
if isinstance(inputdata, bytes):
cmpstr = b'!entity'
else:
cmpstr = '!entity'
if cmpstr in inputdata.lower():
raise Exception('!ENTITY not supported in this interface')
return rfromstring(inputdata)