From d93fb702eb9a84fbe6a42bf0ec523de4161e16a8 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 11 Feb 2019 18:53:52 +0100 Subject: [PATCH] makepanda: fix various syntax warnings in Python 3.8 --- makepanda/installpanda.py | 2 +- makepanda/makechm.py | 18 +++++++++--------- makepanda/makepanda.py | 16 ++++++++-------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/makepanda/installpanda.py b/makepanda/installpanda.py index ef8ddeab7e..dcb18a72bf 100644 --- a/makepanda/installpanda.py +++ b/makepanda/installpanda.py @@ -62,7 +62,7 @@ def WriteMimeXMLFile(fname, info): fhandle.write("\t\n" % (mime)) fhandle.write("\t\t%s\n" % (desc)) fhandle.write("\t\t\n" % (ext)) - fhandle.write("\t\s") + fhandle.write("\t\n") fhandle.write("\n") fhandle.close() diff --git a/makepanda/makechm.py b/makepanda/makechm.py index 1127eb41f5..5a14813380 100755 --- a/makepanda/makechm.py +++ b/makepanda/makechm.py @@ -213,11 +213,11 @@ def makeCHM(outputfile, dirname, title, special = None): # Now, execute the command to compile the files. if "PROGRAMFILES" in os.environ and os.path.isdir("%s\\HTML Help Workshop" % os.environ["PROGRAMFILES"]): cmd = "\"%s\\HTML Help Workshop\\hhc.exe\" %s.hhp" % (os.environ["PROGRAMFILES"], base) - elif os.path.isdir("C:\Program Files\HTML Help Workshop"): + elif os.path.isdir("C:\\Program Files\\HTML Help Workshop"): cmd = "\"C:\\Program Files\\HTML Help Workshop\\hhc.exe\" %s.hhp" % base else: cmd = "hhc \"%s.hhp\"" % base - print cmd + print(cmd) os.system(cmd) if not KEEPTEMP: if os.path.isfile("%s.hhp" % base): os.remove("%s.hhp" % base) @@ -225,7 +225,7 @@ def makeCHM(outputfile, dirname, title, special = None): if os.path.isfile("%s.hhk" % base): os.remove("%s.hhk" % base) if os.path.isfile("%s.chw" % base): os.remove("%s.chw" % base) if not os.path.isfile(base + ".chm"): - print "An error has occurred!" + print("An error has occurred!") if __name__ == "__main__": exit(1) else: @@ -246,7 +246,7 @@ if __name__ == "__main__": VERSION = None try: f = file("built/include/pandaVersion.h","r") - pattern = re.compile('^\s*[#]\s*define\s+PANDA_VERSION_STR\s+["]([0-9.]+)["]') + pattern = re.compile('^\\s*[#]\\s*define\\s+PANDA_VERSION_STR\\s+["]([0-9.]+)["]') for line in f: match = pattern.match(line,0) if (match): @@ -260,22 +260,22 @@ if __name__ == "__main__": # Now, make CHM's for both the manual and reference, if we have them. for lang in ["python", "cxx"]: if not os.path.isdir("manual-" + lang): - print "No directory named 'manual-%s' found" % lang + print("No directory named 'manual-%s' found" % lang) else: - print "Making CHM file for manual-%s..." % lang + print("Making CHM file for manual-%s..." % lang) if VERSION == None: makeManualCHM("manual-%s.chm" % lang, "manual-" + lang, "Panda3D Manual") else: makeManualCHM("manual-%s-%s.chm" % (VERSION, lang), "manual-" + lang, "Panda3D %s Manual" % VERSION) if not os.path.isdir("reference-" + lang): - print "No directory named 'reference-%s' found" % lang + print("No directory named 'reference-%s' found" % lang) else: - print "Making CHM file for reference-%s..." % lang + print("Making CHM file for reference-%s..." % lang) if VERSION == None: makeReferenceCHM("reference-%s.chm" % lang, "reference-" + lang, "Panda3D Reference") else: makeReferenceCHM("reference-%s-%s.chm" % (VERSION, lang), "reference-" + lang, "Panda3D %s Reference" % VERSION) - print "Done!" + print("Done!") diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 792bf5ebfc..3251c3272a 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -1570,7 +1570,7 @@ def CompileIgate(woutd,wsrc,opts): # NOTE: this 1600 value is the version number for VC2010. cmd += ' -D_MSC_VER=1600 -D"__declspec(param)=" -D__cdecl -D_near -D_far -D__near -D__far -D__stdcall' if (COMPILER=="GCC"): - cmd += ' -D__attribute__\(x\)=' + cmd += ' -D__attribute__\\(x\\)=' target_arch = GetTargetArch() if target_arch in ("x86_64", "amd64"): cmd += ' -D_LP64' @@ -1675,9 +1675,9 @@ def CompileLib(lib, obj, opts): cmd += " /MACHINE:" + GetTargetArch().upper() cmd += ' /OUT:' + BracketNameWithQuotes(lib) for x in obj: cmd += ' ' + BracketNameWithQuotes(x) - cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\ipp\lib\ia32"' - cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\TBB\Lib\ia32\vc10"' - cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\compiler\lib\ia32"' + cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"' + cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"' + cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"' oscmd(cmd) if (COMPILER=="GCC"): @@ -1783,9 +1783,9 @@ def CompileLink(dll, obj, opts): cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT" cmd += " /NOD:LIBCI.LIB /DEBUG" cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls" - cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\ipp\lib\ia32"' - cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\TBB\Lib\ia32\vc10"' - cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\compiler\lib\ia32"' + cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"' + cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"' + cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"' if (GetOrigExt(dll) != ".exe"): cmd += " /DLL" optlevel = GetOptimizeOption(opts) if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB" @@ -6648,7 +6648,7 @@ if PkgSkip("PYTHON") == 0: if GetTarget() == 'linux' or GetTarget() == 'freebsd': # Setup rpath so libs can be found in the same directory as the deployed game - LibName('DEPLOYSTUB', "-Wl,-rpath,\$ORIGIN") + LibName('DEPLOYSTUB', "-Wl,-rpath,\\$ORIGIN") LibName('DEPLOYSTUB', "-Wl,-z,origin") LibName('DEPLOYSTUB', "-rdynamic") PyTargetAdd('deploy-stub.exe', input='deploy-stub.obj')