diff --git a/Common/OS.cpp b/Common/OS.cpp index edc7ecdeafe4f3a9f176944edc0297f16e97d6a2..3202ced94920ee9a73694599b7660ce08328f5ae 100644 --- a/Common/OS.cpp +++ b/Common/OS.cpp @@ -254,12 +254,14 @@ int SystemCall(const std::string &command, bool blocking) #else std::string cmd(command); if(split[2] == ".py" || split[2] == ".PY"){ - if(split[0].empty()) cmd = "./" + cmd; if(access(exe.c_str(), X_OK)){ - Msg::Info("Script '%s' is not executable: running with python", - exe.c_str()); + Msg::Info("Script '%s' is not executable: running with python", exe.c_str()); cmd = "python " + cmd; } + else if(split[0].empty()){ + // workaround if pwd is not in PATH + cmd = "./" + cmd; + } } if(!system(NULL)) { Msg::Error("Could not find /bin/sh: aborting system call");