Skip to content

Commit

Permalink
Update PythonDataProvider.cs
Browse files Browse the repository at this point in the history
Add a little more error checking/reporting when running Python
  • Loading branch information
jas88 committed Nov 13, 2023
1 parent e358c41 commit 8a593c0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private int ExecuteProcess(IDataLoadEventListener listener, string script, int m
{
var processStartInfo = new ProcessStartInfo
{
FileName = GetPythonCommand(),
FileName = GetPythonCommand() ?? throw new Exception("No Python executable found"),
Arguments = script,
RedirectStandardOutput = true,
RedirectStandardError = true,
Expand Down Expand Up @@ -298,8 +298,8 @@ public string GetFullPythonPath()

var path = pathKey.GetValue("ExecutablePath")?.ToString() ?? Path.Combine(pathKey?.GetValue(null)?.ToString() ?? "DUMMY","python.exe");

if (!path.Contains("DUMMY",StringComparison.Ordinal))
yield return (minor,fullVersion.ToString()??"0.0.0", path.ToString()??"none");
if (File.Exists(path))
yield return (minor,fullVersion.ToString()??"0.0.0", path);
}
}

Expand Down

0 comments on commit 8a593c0

Please sign in to comment.