diff --git a/photon-lib/build.gradle b/photon-lib/build.gradle index e52f528605..b55a3ad259 100644 --- a/photon-lib/build.gradle +++ b/photon-lib/build.gradle @@ -43,12 +43,12 @@ nativeUtils { def getPythonIncludePath = { def pythonexe = project.findProperty('pythonExecutable') ?: 'python3' - File.createTempFile("temp",".py").with { - write "from sysconfig import get_paths as gp; print(gp()['include'])" + File.createTempFile("temp",".py").with { f -> + f.write "from sysconfig import get_paths as gp; print(gp()['include'])" def stdout = new ByteArrayOutputStream() exec { - commandLine pythonexe, '-c', 'from sysconfig import get_paths as gp; print(gp()["include"])' + commandLine pythonexe, f.absolutePath standardOutput = stdout } def ret = stdout.toString().trim();