xla
xla copied to clipboard
Fix `GetExecutablePath(..)` for the case when a command flag is passed to the python executable.
Fix GetExecutablePath(..) for the case when a command flag is passed to the python executable.
Currently GetExecutablePath(..) returns an empty string if the command python -c '<code splitted by new lines>' is executed. The reason is that the first token in the buffer might be a whitespace or a new line.
To avoid this situation, we check if the flag is -c. If it is, we return the preceding token as an executable path.