Skip to content

Comments

disable limited api for no gil 3.14#715

Open
DmitriyMusatkin wants to merge 1 commit intomainfrom
no_gil_build
Open

disable limited api for no gil 3.14#715
DmitriyMusatkin wants to merge 1 commit intomainfrom
no_gil_build

Conversation

@DmitriyMusatkin
Copy link
Contributor

Issue #, if available:

Description of changes:
3.14 no gil does not support limited api. disable it for now.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

extra_link_args += ['-Wl,--fatal-warnings']

if hasattr(sys, '_is_gil_enabled'):
has_gil = sys._is_gil_enabled()

Choose a reason for hiding this comment

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

Just happened to come across this. You don't want to spell it this way, because the GIL might be disabled or enabled at runtime, which is what this API checks.

Instead, you want to check if you're using a free-threaded interpreter, which I spell like:

import sysconfig;

FREE_THREADED_BUILD = sysconfig.get_config_var("Py_GIL_DISABLED")

And then switch on whether to use the limited API based on that.

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