-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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_OBJECT_CVT should use namespace for error_already_set() #3797
PYBIND11_OBJECT_CVT should use namespace for error_already_set() #3797
Conversation
This change makes the macro usable outside of pybind11 namespace.
How did you discover this? |
I discovered it by building a toy pybind11 extensions To test the change I can try building a simple class outside of pybind11 namespace which wraps |
…pybind11 namespaces
The added test defines a dummy function that takes a custom-defined class external::float_ that uses PYBIND11_OBJECT_CVT
Test has been added in |
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks!
Just waiting for the CI to finish.
valgrind is detecting a leak and clang-tidy has two complaints:
I missed the leak when I looked at the test code before. Looking again. |
I am about to push a change to fix this. |
@rwgk Thanks for your help. The CI is now green. |
Thanks @oleksandr-pavlyk! |
…ind#3797) * PYBIND11_OBJECT_CVT should use namespace for error_already_set() This change makes the macro usable outside of pybind11 namespace. * added test for use of PYBIND11_OBJECT_CVT for classes in external to pybind11 namespaces * Extended test_pytypes.cpp and test_pytest.py The added test defines a dummy function that takes a custom-defined class external::float_ that uses PYBIND11_OBJECT_CVT * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed issues pointed out by CI * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed memory leak in default constructor Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…ind#3797) * PYBIND11_OBJECT_CVT should use namespace for error_already_set() This change makes the macro usable outside of pybind11 namespace. * added test for use of PYBIND11_OBJECT_CVT for classes in external to pybind11 namespaces * Extended test_pytypes.cpp and test_pytest.py The added test defines a dummy function that takes a custom-defined class external::float_ that uses PYBIND11_OBJECT_CVT * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed issues pointed out by CI * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed memory leak in default constructor Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This change makes the macro usable outside of pybind11 namespace.
Description
Change to
PYBIND11_OBJECT_CVT
macro to fully qualifyerror_already_set
used in constructors. This change allows macro to be used outside ofpybind11
namespace.Suggested changelog entry: