File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -525,9 +525,6 @@ struct string_caster {
525525 return false ;
526526 }
527527 value = StringType (buffer, static_cast <size_t >(size));
528- if (IsView) {
529- loader_life_support::add_patient (src);
530- }
531528 return true ;
532529 }
533530
@@ -605,9 +602,6 @@ struct string_caster {
605602 pybind11_fail (" Unexpected PYBIND11_BYTES_AS_STRING() failure." );
606603 }
607604 value = StringType (bytes, (size_t ) PYBIND11_BYTES_SIZE (src.ptr ()));
608- if (IsView) {
609- loader_life_support::add_patient (src);
610- }
611605 return true ;
612606 }
613607 if (PyByteArray_Check (src.ptr ())) {
@@ -618,9 +612,6 @@ struct string_caster {
618612 pybind11_fail (" Unexpected PyByteArray_AsString() failure." );
619613 }
620614 value = StringType (bytearray, (size_t ) PyByteArray_Size (src.ptr ()));
621- if (IsView) {
622- loader_life_support::add_patient (src);
623- }
624615 return true ;
625616 }
626617
Original file line number Diff line number Diff line change @@ -582,16 +582,6 @@ TEST_SUBMODULE(stl, m) {
582582 [](const std::list<std::string> &) { return 2 ; });
583583 m.def (" func_with_string_or_vector_string_arg_overload" , [](const std::string &) { return 3 ; });
584584
585- #ifdef PYBIND11_HAS_STRING_VIEW
586- m.def (" func_with_string_views" , [](const std::vector<std::string_view> &svs) {
587- py::list l;
588- for (std::string_view sv : svs) {
589- l.append (sv);
590- }
591- return l;
592- });
593- #endif
594-
595585 class Placeholder {
596586 public:
597587 Placeholder () { print_created (this ); }
Original file line number Diff line number Diff line change @@ -28,18 +28,6 @@ def test_vector(doc):
2828 # Test regression caused by 936: pointers to stl containers weren't castable
2929 assert m .cast_ptr_vector () == ["lvalue" , "lvalue" ]
3030
31- if hasattr (m , "func_with_string_views" ):
32-
33- def gen ():
34- return ("a" + str (x ) for x in range (10000 , 10010 ))
35-
36- expected = list (gen ())
37- assert m .func_with_string_views (gen ()) == expected
38- assert m .func_with_string_views (x .encode () for x in gen ()) == expected
39- assert (
40- m .func_with_string_views (bytearray (x .encode ()) for x in gen ()) == expected
41- )
42-
4331
4432def test_deque ():
4533 """std::deque <-> list"""
You can’t perform that action at this time.
0 commit comments