mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
don't rely on being able to call the python build we're building against
This commit is contained in:
parent
7553c9d01a
commit
34fd8f0c4d
@ -1785,12 +1785,14 @@ def SdkLocatePython(force_use_sys_executable = False):
|
|||||||
if (not os.path.isfile(SDK["PYTHONEXEC"])):
|
if (not os.path.isfile(SDK["PYTHONEXEC"])):
|
||||||
exit("Could not find %s!" % SDK["PYTHONEXEC"])
|
exit("Could not find %s!" % SDK["PYTHONEXEC"])
|
||||||
|
|
||||||
os.system(SDK["PYTHONEXEC"] + " -V > "+OUTPUTDIR+"/tmp/pythonversion 2>&1")
|
# Determine which version it is by checking which dll is in the directory.
|
||||||
pv = ReadFile(OUTPUTDIR + "/tmp/pythonversion")
|
py_dlls = glob.glob(SDK["PYTHON"] + "/python[0-9][0-9].dll")
|
||||||
if (pv.startswith("Python ")==0):
|
if len(py_dlls) == 0:
|
||||||
exit("python -V did not produce the expected output")
|
exit("Could not find the Python dll in %s." % (SDK["PYTHON"]))
|
||||||
pv = pv[7:10]
|
elif len(py_dlls) > 1:
|
||||||
SDK["PYTHONVERSION"]="python"+pv
|
exit("Found multiple Python dlls in %s." % (SDK["PYTHON"]))
|
||||||
|
|
||||||
|
SDK["PYTHONVERSION"] = "python" + py_dlls[0][-6] + "." + py_dlls[0][-5]
|
||||||
|
|
||||||
elif (GetTarget() == 'windows'):
|
elif (GetTarget() == 'windows'):
|
||||||
SDK["PYTHON"] = os.path.dirname(sysconfig.get_python_inc())
|
SDK["PYTHON"] = os.path.dirname(sysconfig.get_python_inc())
|
||||||
@ -1802,6 +1804,9 @@ def SdkLocatePython(force_use_sys_executable = False):
|
|||||||
SDK["PYTHONVERSION"] = "python" + sysconfig.get_python_version()
|
SDK["PYTHONVERSION"] = "python" + sysconfig.get_python_version()
|
||||||
SDK["PYTHONEXEC"] = os.path.realpath(sys.executable)
|
SDK["PYTHONEXEC"] = os.path.realpath(sys.executable)
|
||||||
|
|
||||||
|
if GetVerbose():
|
||||||
|
print("Using Python %s build located at %s" % (SDK["PYTHONVERSION"][6:9], SDK["PYTHON"]))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
SDK["PYTHONEXEC"] = os.path.realpath(sys.executable)
|
SDK["PYTHONEXEC"] = os.path.realpath(sys.executable)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user