diff options
author | Jie Luo <jieluo@google.com> | 2017-03-29 15:54:06 -0700 |
---|---|---|
committer | Jie Luo <jieluo@google.com> | 2017-03-29 15:54:06 -0700 |
commit | c348d46a9bd2b264bf4155f8a26c3715ca9ea584 (patch) | |
tree | b65dbd604233aae888b52212fe629c4c2f4d9b79 /python/google/protobuf/pyext/message.cc | |
parent | 689e4bf5f4d42c4adda3bdbd29d6666f3ddea971 (diff) | |
download | protobuf-c348d46a9bd2b264bf4155f8a26c3715ca9ea584.tar.gz protobuf-c348d46a9bd2b264bf4155f8a26c3715ca9ea584.tar.bz2 protobuf-c348d46a9bd2b264bf4155f8a26c3715ca9ea584.zip |
Use PyUnicode_AsEncodedString() instead of PyUnicode_AsEncodedObject()
Diffstat (limited to 'python/google/protobuf/pyext/message.cc')
-rw-r--r-- | python/google/protobuf/pyext/message.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/python/google/protobuf/pyext/message.cc b/python/google/protobuf/pyext/message.cc index c810b788..85aaa46f 100644 --- a/python/google/protobuf/pyext/message.cc +++ b/python/google/protobuf/pyext/message.cc @@ -779,7 +779,7 @@ PyObject* CheckString(PyObject* arg, const FieldDescriptor* descriptor) { encoded_string = arg; // Already encoded. Py_INCREF(encoded_string); } else { - encoded_string = PyUnicode_AsEncodedObject(arg, "utf-8", NULL); + encoded_string = PyUnicode_AsEncodedString(arg, "utf-8", NULL); } } else { // In this case field type is "bytes". |