diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2019-04-09 17:43:29 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2019-04-09 17:43:29 -0400 |
commit | 185ca5939021fc16d393ca99bf5bb030fe9eb4b3 (patch) | |
tree | 8f019380b45b407721d50cdeb9a1e53856c800ac /buildscripts | |
parent | 2726092ccd5249ce44a0d0c784d612028036cb3e (diff) | |
download | mongo-185ca5939021fc16d393ca99bf5bb030fe9eb4b3.tar.gz |
SERVER-40542 buildscripts\make_vcxproj.py does not work with Python 3
Diffstat (limited to 'buildscripts')
-rw-r--r-- | buildscripts/make_vcxproj.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/buildscripts/make_vcxproj.py b/buildscripts/make_vcxproj.py index 6b8fc04730a..6af1007bea5 100644 --- a/buildscripts/make_vcxproj.py +++ b/buildscripts/make_vcxproj.py @@ -112,15 +112,15 @@ def _replace_vcxproj(file_name, restore_elements): stream = io.StringIO() - tree.write(stream) + tree.write(stream, encoding='unicode') - str_value = stream.getvalue().encode() + str_value = stream.getvalue() # Strip the "ns0:" namespace prefix because ElementTree does not support default namespaces. str_value = str_value.replace("<ns0:", "<").replace("</ns0:", "</").replace( "xmlns:ns0", "xmlns") - with io.open(file_name, mode='wb') as file_handle: + with io.open(file_name, mode='w') as file_handle: file_handle.write(str_value) @@ -150,7 +150,7 @@ class ProjFileGenerator(object): # pylint: disable=too-many-instance-attributes return self def __exit__(self, exc_type, exc_value, traceback): - self.vcxproj = open(self.vcxproj_file_name, "wb") + self.vcxproj = open(self.vcxproj_file_name, "w", ) with open('buildscripts/vcxproj.header', 'r') as header_file: header_str = header_file.read() @@ -180,7 +180,7 @@ class ProjFileGenerator(object): # pylint: disable=too-many-instance-attributes self.vcxproj.write(" <ClCompile Include=\"" + command["file"] + "\" />\n") self.vcxproj.write(" </ItemGroup>\n") - self.filters = open(self.target + ".vcxproj.filters", "wb") + self.filters = open(self.target + ".vcxproj.filters", "w") self.filters.write("<?xml version='1.0' encoding='utf-8'?>\n") self.filters.write("<Project ToolsVersion='14.0' " + "xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>\n") |