-
Notifications
You must be signed in to change notification settings - Fork 139
Python: Autodetect version issue (26.2) [STUD-78782] #511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -28,6 +28,7 @@ public void Dispose() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //Prevent process leak in certain error scenarios | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Proc?.Kill(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Proc?.Dispose(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Proc = null; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
30
to
32
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Proc?.Kill(); | |
| Proc?.Dispose(); | |
| Proc = null; | |
| var proc = Proc; | |
| if (proc != null) | |
| { | |
| try | |
| { | |
| // Attempt to kill the process only if it has not already exited. | |
| if (!proc.HasExited) | |
| { | |
| proc.Kill(); | |
| } | |
| } | |
| catch (InvalidOperationException) | |
| { | |
| // Process may have already exited or have no associated process; ignore in dispose path. | |
| } | |
| catch (System.ComponentModel.Win32Exception) | |
| { | |
| // Access denied or other OS-level issue; ignore in dispose path to avoid masking earlier errors. | |
| } | |
| finally | |
| { | |
| proc.Dispose(); | |
| Proc = null; | |
| } | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR description mentions searching in the install folder and in the
../binfolder, but the current candidate generation only checkspathandpath/binviaPythonBinFolders = ["", "bin"]. Ifpathcan point at a.../liblocation (common for some Python envs), the executable will be in a sibling../binand won’t be found. Consider adding an explicit../bincandidate (e.g., includePath.Combine("..", "bin")in the folder list) and normalizing withGetFullPathafter combining.