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> {
// Conversion part 2 (C++ -> Python)
static handle cast(const absl::Cord& src, return_value_policy policy,
handle parent) {
return StringViewCaster::cast(
absl::string_view(std::string(src)), policy, parent);
return bytes(std::string(src)).release();
}
};
......
......@@ -361,9 +361,9 @@ class AbslCordTest(absltest.TestCase):
def test_return_absl_cord(self):
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(
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):
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