Skip to content

Commit 6ce5ebd

Browse files
committed
update DOMEntityResolver._guess_media_encoding for python 3
1 parent 4e2c24c commit 6ce5ebd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/xml/dom/xmlbuilder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ def _create_opener(self):
248248
def _guess_media_encoding(self, source):
249249
info = source.byteStream.info()
250250
if "Content-Type" in info:
251-
for param in info.getplist():
252-
if param.startswith("charset="):
253-
return param.split("=", 1)[1].lower()
251+
for param in info.get_params([]):
252+
if param[0] == 'charset':
253+
return param[1].lower()
254254

255255

256256
class DOMInputSource(object):

0 commit comments

Comments
 (0)