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

[lldb] Update python deprecated APIs. #7756

Merged

Conversation

medismailben
Copy link
Member

@medismailben medismailben commented Nov 6, 2023

This patch cherry-picks some patches from upstream to get rid of some deprecated python modules/APIs and replace them with their new equivalent.

rdar://117331497

tuliom and others added 3 commits November 6, 2023 11:11
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)
)

imp got removed in Python 3.12 [1] and the community recommends using
importlib in newer Python versions.

[1] https://docs.python.org/3.12/whatsnew/3.12.html#imp

(cherry picked from commit 2260ebf)
… (NFC) (llvm#70732)

This should silence the "misleading indentiation" warnings introduced by
b2929be, by adding an no-op if-statement, if the surrounding
if-statement have been compiled out.

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
@medismailben
Copy link
Member Author

@swift-ci test

@medismailben
Copy link
Member Author

@swift-ci test windows platform

1 similar comment
@shahmishal
Copy link
Member

@swift-ci test windows platform

@medismailben medismailben merged commit a047009 into apple:swift/release/5.10 Nov 7, 2023
3 checks passed
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.

None yet

3 participants