Skip to content

Commit

Permalink
Update gyp/pylib/gyp/easy_xml.py
Browse files Browse the repository at this point in the history
Co-authored-by: Christian Clauss <[email protected]>
  • Loading branch information
owl-from-hogvarts and cclauss authored Nov 6, 2020
1 parent 1fad283 commit c921c42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gyp/pylib/gyp/easy_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ 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.version_info[0] >= 3) and (sys.version_info[1] >= 7):
if sys.version_info >= (3, 7):
xml_string = xml_string.encode(encoding)
else:
xml_string = xml_string.decode("cp1251").encode(encoding)
Expand Down

0 comments on commit c921c42

Please sign in to comment.