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
Fix #11334: Cannot make multi-line code blocks in ipython #11354
Conversation
When codeop.compile_command() returns None it actually says "at least some part of the code was compiled successfully" which is not really important for checking if it's complete or not. Once we haven't got any errors during compilation process, we just want to check if there will be another nested block of code or not by checking a colon.
That seem incorrect, now |
Yeah, I have already fixed it. Trying to run a test suit locally but I get a lot of errors and unfortunately can't understand why (is there any dev-guide how to develop ipython locally?). Anyway, I'm pushing the fix, to see what CI will say... |
Seems it's OK now |
There seem to be some more edge cases:
Appear as incomplete and adds a new line with 4 spaces.
Appear as complete an executes. |
I am very busy today but this looks like an another bug to me that we haven't noticed before because of this bug. If there is at least one space in the last line (blank) then the line is complete.
this seem to work correctly. The bug is in a code before I can take a look in it closer but not before weekend. |
If so, this helped me to focus back to the Going off for a day or two, leaving the comment for notes, but feel free to share some information if you have or finish the fix obviously ;-) PS. @Carreau is there any guide how to develop and test locally IPython? When I want to use IPython installed globally (to meet all requirements etc.) I have no access to the IPython-dev directory as all imports are already done for starting IPython itself. I can figure it out how to do this but maybe there is a note about it somewhere? |
@takluyver wrote most of this,
Clone the repo and run I use https://github.com/ipython/ipython#development-and-instant-running is basically links to longer versions than this. If I have time outside of $DAYJOB I'll try have a look, but @takluyver is the expert, and @tonyfast sent a PR to fix another bug recently so may have some insights. |
When codeop.compile_command() returns None it actually says "at least
some part of the code was compiled successfully" which is not really important
for checking if it's complete or not.
Once we haven't got any errors during compilation process, we just want
to check if there will be another nested block of code or not by checking
a colon.