Skip to content

Conversation

@Lalufu
Copy link
Contributor

@Lalufu Lalufu commented Dec 16, 2023

This partially reverts some of the work done in
1881628.

This removes some code reordering done in the above commit to work around the fact that, starting in 3.12, PyImport_AppendInittab() could no longer be called after Py_Initialize().

This patch reverts this reordering, and takes a different approach to add the uwsgi python module to the plugin.

This is mainly done to support the https://pypi.org/project/pyuwsgi/ use case where the uwsgi server itself is a python module, and hence the interpreter will always be initialized before uwsgi even starts.

It's also a bit cleaner, there's less code getting rearranged to support 3.12.


#ifdef PYTHREE
#ifndef UWSGI_PY312
# ifndef UWSGI_PY312
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you keep all the ifdefery at column 0 please?

@Lalufu Lalufu force-pushed the lalufu/feature-python312-part-2 branch from 5d4aab0 to 7865982 Compare December 26, 2023 15:03
This partially reverts some of the work done in
1881628.

This removes some code reordering done in the above commit to work
around the fact that, starting in 3.12, `PyImport_AppendInittab()` could
no longer be called after `Py_Initialize()`.

This patch reverts this reordering, and takes a different approach to
add the `uwsgi` python module to the plugin.

This is mainly done to support the https://pypi.org/project/pyuwsgi/ use
case where the uwsgi server itself is a python module, and hence the
interpreter will always be initialized before uwsgi even starts.

It's also a bit cleaner, there's less code getting rearranged to support
3.12.
@Lalufu Lalufu force-pushed the lalufu/feature-python312-part-2 branch from 7865982 to 973fc9a Compare December 26, 2023 18:20
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