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

Fix runtime python version check #1625

Merged
merged 6 commits into from
Jul 6, 2024

Conversation

michaelortmann
Copy link
Member

Found by: michaelortmann
Patch by: michaelortmann
Fixes:

One-line summary:
Fix runtime python version check

Additional description (if needed):

Test cases demonstrating functionality (if applicable):

@thommey
Copy link
Member

thommey commented Jun 29, 2024

The version check is pointless because it's not runtime. Runtime version check seems to be unsupported until much later Python versions unless you can find a workaround?
Otherwise just remove the check entirely, right now it checks the header which we can do at compile time.

@michaelortmann
Copy link
Member Author

michaelortmann commented Jun 30, 2024

We would also have to fix: 093cc36#diff-43cfee5e2cf04e6a2a99e0e92600b37c9701db5d94adf8d515785f97c1ebe626 ?

What does "much later" mean? Py_GetVersion() is available since at least python 2.6:

https://docs.python.org/2.6/c-api/init.html#Py_GetVersion

Digging deeper, since at least python 2.2:

https://docs.python.org/release/2.2/api/initialization.html

Not enough?

@vanosg
Copy link
Member

vanosg commented Jul 4, 2024

Because the version is checked at compile, please remove the check here. This is an artifact from before the check was added to compile. Thanks!

@michaelortmann
Copy link
Member Author

Done. I left the change to char *init_python(), for as the TODO comment above the function already says, we dont want to exit eggdrop if we dont have to, and quickly going over the code i cant see why we have to. To keep PRs small lets resolve the TODO in another/future PR.

@thommey
Copy link
Member

thommey commented Jul 6, 2024

I confused Py_GetVersion with Py_Version (constant) which has only been added to 3.11, looks good to me

@vanosg vanosg merged commit e23f8b7 into eggheads:develop Jul 6, 2024
22 checks passed
@michaelortmann michaelortmann deleted the python.version branch July 6, 2024 19:33
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.

3 participants