Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments

Update threading checks to be compatible with Python 3.13#551

Merged
bsteffensmeier merged 1 commit intoninia:dev_4.2from
bsteffensmeier:python313-threading-updates
Aug 31, 2024
Merged

Update threading checks to be compatible with Python 3.13#551
bsteffensmeier merged 1 commit intoninia:dev_4.2from
bsteffensmeier:python313-threading-updates

Conversation

@bsteffensmeier
Copy link
Member

Python 3.13 is changing the way threading.active_count() works in sub-interpreters. In previous versions when no other threads in the interpreter are active then there is only 1 active thread. New in Python 3.13 the main thread if the main interpreter is included in the active_count() of sub-interpreters so there will always be 2 active threads. Since we check for active threads before ending the interpreter those checks are being updated for compatibility. The changes to Python that made this change necessary were made under python/cpython#114271. This problem was discovered in Python 3.13rc1 and the change has been verified in that version.

Copy link
Member

@ndjensen ndjensen left a comment

Choose a reason for hiding this comment

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

Looks good.

@bsteffensmeier bsteffensmeier merged commit e3a8029 into ninia:dev_4.2 Aug 31, 2024
@bsteffensmeier bsteffensmeier deleted the python313-threading-updates branch October 22, 2024 01:02
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