mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-11 05:17:59 +03:00
python3 compat: python3 strings have no decode()
This commit is contained in:
parent
4d9c6141dd
commit
5146d66126
@ -829,7 +829,11 @@ class XMLBuilder(object):
|
||||
self.conn = conn
|
||||
|
||||
if self._XML_SANITIZE:
|
||||
parsexml = parsexml.decode('ascii', 'ignore').encode('ascii')
|
||||
if hasattr(parsexml, 'decode'):
|
||||
parsexml = parsexml.decode("ascii", "ignore").encode("ascii")
|
||||
else:
|
||||
parsexml = parsexml.encode("ascii", "ignore").decode("ascii")
|
||||
|
||||
parsexml = "".join([c for c in parsexml if c in string.printable])
|
||||
|
||||
self._propstore = {}
|
||||
|
Loading…
Reference in New Issue
Block a user