Commit 03ee7687 by Xiaofei Wang Committed by Copybara-Service

Internal change

PiperOrigin-RevId: 474334488
parent 2b69d826
...@@ -445,8 +445,7 @@ struct type_caster<absl::Cord> { ...@@ -445,8 +445,7 @@ struct type_caster<absl::Cord> {
// Conversion part 2 (C++ -> Python) // Conversion part 2 (C++ -> Python)
static handle cast(const absl::Cord& src, return_value_policy policy, static handle cast(const absl::Cord& src, return_value_policy policy,
handle parent) { handle parent) {
return StringViewCaster::cast( return bytes(std::string(src)).release();
absl::string_view(std::string(src)), policy, parent);
} }
}; };
......
...@@ -361,9 +361,9 @@ class AbslCordTest(absltest.TestCase): ...@@ -361,9 +361,9 @@ class AbslCordTest(absltest.TestCase):
def test_return_absl_cord(self): def test_return_absl_cord(self):
self.assertSequenceEqual( self.assertSequenceEqual(
absl_example.return_absl_cord(self.TEST_STRING), self.TEST_STRING) absl_example.return_absl_cord(self.TEST_STRING), self.TEST_BYTES)
self.assertSequenceEqual( self.assertSequenceEqual(
absl_example.return_absl_cord(self.TEST_BYTES), self.TEST_STRING) absl_example.return_absl_cord(self.TEST_BYTES), self.TEST_BYTES)
def test_pass_absl_cord(self): def test_pass_absl_cord(self):
self.assertTrue( self.assertTrue(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment