diff --git a/gyp/pylib/gyp/easy_xml.py b/gyp/pylib/gyp/easy_xml.py index 43a9ef7b7b..e8129b139c 100644 --- a/gyp/pylib/gyp/easy_xml.py +++ b/gyp/pylib/gyp/easy_xml.py @@ -122,12 +122,8 @@ def WriteXmlIfChanged(content, path, encoding="utf-8", pretty=False, win32=False default_encoding = locale.getdefaultlocale()[1] if default_encoding and default_encoding.upper() != encoding.upper(): - if sys.platform == "win32": - if (sys.version_info[0] + sys.version_info[1] * 0.1) > 3.7: - xml_string = xml_string.encode(encoding) - else: - xml_string = xml_string.decode("cp1251").encode(encoding) - # for non windows systems + if sys.platform == "win32" and sys.version_info < (3, 7): + xml_string = xml_string.decode("cp1251").encode(encoding) else: xml_string = xml_string.encode(encoding)