diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index f2c029113a..1ceb189281 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -303,7 +303,7 @@ class type_caster : public type_caster { template using cast_op_type = void *&; explicit operator void *&() { return value; } - static constexpr auto name = const_name("capsule"); + static constexpr auto name = const_name("types.CapsuleType"); private: void *value = nullptr; @@ -1000,7 +1000,7 @@ struct handle_type_name { }; template <> struct handle_type_name { - static constexpr auto name = const_name("capsule"); + static constexpr auto name = const_name("types.CapsuleType"); }; template <> struct handle_type_name { diff --git a/tests/test_opaque_types.py b/tests/test_opaque_types.py index 56c9b5db19..498b6e02b2 100644 --- a/tests/test_opaque_types.py +++ b/tests/test_opaque_types.py @@ -41,7 +41,7 @@ def test_pointers(msg): msg(excinfo.value) == """ get_void_ptr_value(): incompatible function arguments. The following argument types are supported: - 1. (arg0: capsule) -> int + 1. (arg0: types.CapsuleType) -> int Invoked with: [1, 2, 3] """