-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
PR: Prevent error when updating sys.path
in consoles (IPython console)
#22490
Conversation
if self.kernel_handler is not None: | ||
self.call_kernel(interrupt=True, blocking=False).update_syspath( | ||
path_dict, new_path_dict | ||
) |
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.
Shouldn't the sys.path
contents that was updated be saved somewhere to properly apply it when kernel_handler
is available? Or maybe there is no possiblitiy that at some point later on the kernel_handler
becomes available?
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.
I thought about that and concluded it's not necessary because this error can only happen when the kernel is not available (because it errored at startup or the Spyder-kernels version is wrong).
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.
Thanks @ccordoba12 !
@meeseeksdev please backport to 6.x |
…th` in consoles (IPython console)
…490-on-6.x Backport PR #22490 on branch 6.x (PR: Prevent error when updating `sys.path` in consoles (IPython console))
Description of Changes
This happened when the kernel was not available and users opened/closed projects or used the Python path manager.
Issue(s) Resolved
Fixes #21563.
Affirmation
By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.
I certify the above statement is true and correct: