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
init_session() on ipython startup file a different mainloop #11419
Comments
It must be from this line. Why is that there? It causes the check below to never be run. |
Oh nevermind, I misread the next line (confused the |
Is the problem here? It assumes that |
It seems this is indeed the case. I did some If you have a script This is expected behavior for them. When we call code inside the IPython REPL, the code is called with all the variables that are defined in scope. When we are not inside it, such as when it is executing the startup script, they are not. The fact that this had not come up yet suggests to me that it is, at most, a very uncommon issue. Also, reading the source of If what I say sounds reasonable to you, I think this can be closed. |
If you feel this should be fixed, they suggested a method relying only on public API that should work even in situations in which |
I am trying to have a startup script for an IPython profile that calls
init_session()
. It seems doing this starts a different IPython mainloop. I can exit it withC-d
and then get to the IPython prompt.I think this has to do with wrongly assuming we are not inside IPython during startup:
The text was updated successfully, but these errors were encountered: