Update Python 3 compatibility

This commit is contained in:
Vinyl Darkscratch
2019-02-09 00:01:11 -08:00
parent fcea326855
commit f434ebec8a
29 changed files with 112 additions and 152 deletions
+2 -2
View File
@@ -57,8 +57,8 @@ def autoDetectXMLEncoding(buffer):
secret_decoder_ring = codecs.lookup(encoding)[1]
(decoded, length) = secret_decoder_ring(buffer)
first_line = decoded.split("\n")[0]
if first_line and first_line.startswith(u"<?xml"):
encoding_pos = first_line.find(u"encoding")
if first_line and first_line.startswith("<?xml"):
encoding_pos = first_line.find("encoding")
if encoding_pos != -1:
# look for double quote
quote_pos = first_line.find('"', encoding_pos)