Fix tryProcess for nonexistent executables on python
This commit is contained in:
@@ -671,12 +671,17 @@ class Prelude {
|
|||||||
}
|
}
|
||||||
#if python
|
#if python
|
||||||
// on Python, after new Process() is called, writing inputLines to stdin becomes impossible. Use python.lib.subprocess instead
|
// on Python, after new Process() is called, writing inputLines to stdin becomes impossible. Use python.lib.subprocess instead
|
||||||
var p = Popen.create([command].concat(args), {
|
var p = try {
|
||||||
stdin: -1, // -1 represents PIPE which allows communication
|
Popen.create([command].concat(args), {
|
||||||
stdout: -1,
|
stdin: -1, // -1 represents PIPE which allows communication
|
||||||
stderr: -1,
|
stdout: -1,
|
||||||
cwd: cwd
|
stderr: -1,
|
||||||
});
|
cwd: cwd
|
||||||
|
});
|
||||||
|
} catch (e:Dynamic) {
|
||||||
|
handleError(Std.string(e));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
if (inputLines != null) {
|
if (inputLines != null) {
|
||||||
for (line in inputLines) {
|
for (line in inputLines) {
|
||||||
p.stdin.write(new Bytearray('$line\n', "utf-8"));
|
p.stdin.write(new Bytearray('$line\n', "utf-8"));
|
||||||
|
Reference in New Issue
Block a user