Python 3.4 compatibility patch

This commit is contained in:
Fierelier 2021-04-01 17:23:29 +02:00
parent 5f251b4593
commit fca281d2c0

View File

@ -315,7 +315,9 @@ def main():
for library in libraries:
if library["type"] == "native":
if "rules" in library and checkRules(library["rules"]) == "disallow": continue
subprocess.run(["7z","x",library["filePathOS"],"-o" +nativesOutPath,"-aos"],check=True,stdout=subprocess.DEVNULL)
proc = subprocess.Popen(["7z","x",library["filePathOS"],"-o" +nativesOutPath,"-aos"],stdout=subprocess.DEVNULL)
rtn = proc.wait()
if rtn != 0: raise Exception("process","return code isn't 0")
launcherVariables = {}
launcherVariables["auth_player_name"] = lv["name"]
@ -371,13 +373,14 @@ def main():
print("\nLaunching Minecraft...")
if lv["console"] == "1":
subprocess.run([lv["java"]] + args,check = True)
proc = subprocess.Popen([lv["java"]] + args)
rtn = proc.wait()
if rtn != 0: raise Exception("process","return code isn't 0")
else:
pkwargs = {
"stdout": subprocess.DEVNULL,
"stdin": subprocess.DEVNULL,
"stderr": subprocess.DEVNULL,
"close_fds": True
}
if lv["osName"] == "windows": pkwargs["creationflags"] = 0x00000008
subprocess.Popen([lv["java"] + "w"] + args,**pkwargs)