From 43a5f2a9f20118db9fcbeec14467c97a711d37b6 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 9 Jan 2017 20:38:33 +0100 Subject: [PATCH] Fixes for Python 3.5: - Disable conversion to Windows newlines, which is causing double Windows newlines for Config.prc - We need to copy vcruntime140.dll to the bin directory for Python 3.5+ build using MSVC 2010 to work --- makepanda/makepanda.py | 6 +++--- makepanda/makepandacore.py | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index ac528371c7..6a7d8ce521 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -2887,8 +2887,8 @@ if tp_dir is not None: pydll += ".dll" CopyFile(GetOutputDir() + "/bin" + pydll, SDK["PYTHON"] + pydll) - #for fn in glob.glob(SDK["PYTHON"] + "/vcruntime*.dll"): - # CopyFile(GetOutputDir() + "/bin/", fn) + for fn in glob.glob(SDK["PYTHON"] + "/vcruntime*.dll"): + CopyFile(GetOutputDir() + "/bin/", fn) # Copy the whole Python directory. CopyTree(GetOutputDir() + "/python", SDK["PYTHON"]) @@ -2907,7 +2907,7 @@ if tp_dir is not None: else: idents = () - for ident in tree.findall('./{urn:schemas-microsoft-com:asm.v1}dependency/{urn:schemas-microsoft-com:asm.v1}dependentAssembly/{urn:schemas-microsoft-com:asm.v1}assemblyIdentity'): + for ident in idents: sxs_name = '_'.join([ ident.get('processorArchitecture'), ident.get('name').lower(), diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index ee903a3940..24f3614337 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -980,7 +980,10 @@ def WriteFile(wfile, data, newline=None): data = data.replace('\n', newline) try: - dsthandle = open(wfile, "w") + if sys.version_info >= (3, 0): + dsthandle = open(wfile, "w", newline='') + else: + dsthandle = open(wfile, "w") dsthandle.write(data) dsthandle.close() except: