Skip to content
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

Update REPL based on asyncio.__main__ in CPython 3.14 #24

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

Sachaa-Thanasius
Copy link
Contributor

@Sachaa-Thanasius Sachaa-Thanasius commented Oct 23, 2024

Technically, more could've been done, but I tried to make the diff minimal for this PR. Some changes include:

  • Adding a return code and keeping it updated so that the REPL can return non-0 values on failure.
  • Running the python startup file before the REPL starts (for better emulation of the actual REPL).
  • Other tidbits (can be enumerated if need be).

Some notes:

  • At the moment, this does not try to remove support for <3.8.
  • This explicitly avoids using _pyrepl because it isn't stable yet and doesn't have a public API.

@Sachaa-Thanasius Sachaa-Thanasius marked this pull request as ready for review October 23, 2024 06:29
@Sachaa-Thanasius
Copy link
Contributor Author

Sachaa-Thanasius commented Oct 23, 2024

I mentioned this in discord, but I'm also putting it here for continuity: turns out codeop.PyCF_ALLOW_INCOMPLETE_INPUT doesn't exist prior to 3.10. That's problematic.

Maybe the differences in codeop before and after that constant (that parser option, really) was added are minimal enough that we can implement branching logic based on its existence. If so, we could use whatever logic codeop had before, bugs and all, to support at least 3.9. I'll try to see if that's the case.

Relevant Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants