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

[6.0][lldb] Update Python deprecated APIs. #8980

Open
wants to merge 1 commit into
base: swift/release/6.0
Choose a base branch
from

Conversation

bc-lee
Copy link

@bc-lee bc-lee commented Jul 13, 2024

This patch cherry-picks some changes from the swift/release/5.10 branch,
where the patches are originally taken from the upstream llvm-project.

Cherry-pick from swift/release/5.10: #7756

Reason: Without this patch, Linux distros with Python 3.13 will
fail to build LLDB due to the usage of removed APIs.

Example error from Fedora Rawhide:
https://download.copr.fedorainfracloud.org/results/leebc/swift-lang-beta/fedora-rawhide-aarch64/07730697-swift-lang/builder-live.log.gz

1. Remove usage of PyEval_ThreadsInitialized and PyEval_InitThreads

Both of these functions were removed in Python 3.13 [1] after being
deprecated since Python 3.9.

According to "What's new in Python 3.13" document [1]:

    Since Python 3.7, Py_Initialize() always creates the GIL: calling
    PyEval_InitThreads() did nothing and PyEval_ThreadsInitialized()
    always returned non-zero.

2. Replace _Py_IsFinalizing() with Py_IsFinalizing().

[1] https://docs.python.org/3.13/whatsnew/3.13.html

(cherry picked from commit b2929be)
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