- string command;
- string const texinputs = os::latex_path_list(
- replaceCurdirPath(path, lyxrc.texinputs_prefix));
- string const sep = string(1, os::path_separator(os::TEXENGINE));
- string const env = getEnv("TEXINPUTS");
-
- switch (os::shell()) {
- case os::UNIX:
- command = path.empty() || lyxrc.texinputs_prefix.empty() ? what
- : "env TEXINPUTS='." + sep + texinputs
- + sep + env + "' " + what;
- break;
- case os::CMD_EXE:
- command = path.empty() || lyxrc.texinputs_prefix.empty() ? what
- : "set TEXINPUTS=." + sep + texinputs
- + sep + env + " & " + what;
- break;
- }
+ string const python_call = "python -tt";
+ string command = to_filesystem8bit(from_utf8(latexEnvCmdPrefix(path)));
+
+ if (prefixIs(what, python_call))
+ command += os::python() + what.substr(python_call.length());
+ else
+ command += what;