Fix IndentationError works differently with cpython in interective shell#4399
Fix IndentationError works differently with cpython in interective shell#4399youknowone merged 4 commits intoRustPython:mainfrom
Conversation
|
I think this PR might have been a bit more complex than needed. As far as I can tell, the main issue here could of been solved by just tweaking the There's also a couple of little issues here, the Indentation Error isn't exactly the right one and now any line containing a comment or space/tabs results in an indent error. The changes to error seem right though, but it can also be slightly tweaked to simplify (matching against it in |
|
@DimitrisJim I agree this fix was too complex, I simplified it in #4406 . The improved fix does exactly what you said with checking for an empty line. There are also cases in continue mode when a non-empty line is given where an error should be thrown, so I accounted for those too. I'll look into what you mentioned about the indentationerror |
Fixes #3892 #4400
Removed the automatic continuing logic that was in place for code that needs multiple lines in the shell to parse correctly. Now we check if full_code can be parsed after each line of input given, but ignoring specific EOF and IndentationLevel errors.
I am working on a way to do this without modifying errors.rs, if I should not be modifying that.
Edit: I think my edits to errors.rs may have improved EOF error handling.