@@ -1677,18 +1677,17 @@ static void warn_relinquish_failed(const char *why, PyObject *o) noexcept {
16771677bool nb_type_relinquish_ownership (PyObject *o, bool cpp_delete) noexcept {
16781678 nb_inst *inst = (nb_inst *) o;
16791679
1680- /* This function is called after nb_type_get() succeeds, so the
1681- instance should be ready; but the !ready case is possible if
1682- an attempt is made to transfer ownership of the same object
1683- to C++ multiple times as part of the same data structure.
1684- For example, converting Python (foo, foo) to C++
1680+ /* This function is called after nb_type_get() succeeds, so the instance
1681+ should be ready; but the !ready case is possible if an attempt is made to
1682+ transfer ownership of the same object to C++ multiple times as part of
1683+ the same data structure. For example, converting Python (foo, foo) to C++
16851684 std::pair<std::unique_ptr<T>, std::unique_ptr<T>>. */
16861685
16871686 if (!inst->ready ) {
16881687 warn_relinquish_failed (
1689- " The resulting data structure would have had multiple "
1690- " std::unique_ptrs that each thought they owned the same "
1691- " Python instance's data, which is not allowed." , o);
1688+ " The resulting data structure would have multiple "
1689+ " std::unique_ptrs, each thinking that they own the same instance, "
1690+ " which is not allowed." , o);
16921691 return false ;
16931692 }
16941693
@@ -1698,8 +1697,8 @@ bool nb_type_relinquish_ownership(PyObject *o, bool cpp_delete) noexcept {
16981697 " This is only possible when the instance was previously "
16991698 " constructed on the C++ side and is now owned by Python, which "
17001699 " was not the case here. You could change the unique pointer "
1701- " signature to std::unique_ptr<T, nb::deleter<T>> to work around "
1702- " this issue." , o);
1700+ " signature to std::unique_ptr<T, nb::deleter<T>> to work "
1701+ " around this issue." , o);
17031702 return false ;
17041703 }
17051704
0 commit comments