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

PYBIND11_TLS_REPLACE_VALUE should use macro argument value in Python … #1683

Merged
merged 1 commit into from
Jun 10, 2019

Conversation

jquesnelle
Copy link
Contributor

The PYBIND11_TLS_REPLACE_VALUE macro doesn't actually use the value argument when using the new Python TLS API (3.7+). Instead, it always uses tstate as the argument. This works because the two places PYBIND11_TLS_REPLACE_VALUE is used in the code the argument is tstate.

  1. PYBIND11_TLS_REPLACE_VALUE(internals.tstate, tstate);
  2. PYBIND11_TLS_REPLACE_VALUE(key, tstate);

However, for correctness, and for anyone piggybacking on pybind's cross-version TLS support (like me!) it should use the value argument

@wjakob
Copy link
Member

wjakob commented Jun 10, 2019

Nice catch!

@wjakob wjakob merged commit f93cd0a into pybind:master Jun 10, 2019
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