aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJie Luo <anandolee@gmail.com>2017-04-05 16:34:54 -0700
committerGitHub <noreply@github.com>2017-04-05 16:34:54 -0700
commit69bfde22b6eb9effd84f7d554b565285e62c0824 (patch)
tree970e2fa5913346b47b69ad8ca75c3754d10d7764
parent139fd0a1c59cdf1f9167e9d3c13428bea7aca85e (diff)
parentc348d46a9bd2b264bf4155f8a26c3715ca9ea584 (diff)
downloadprotobuf-69bfde22b6eb9effd84f7d554b565285e62c0824.tar.gz
protobuf-69bfde22b6eb9effd84f7d554b565285e62c0824.tar.bz2
protobuf-69bfde22b6eb9effd84f7d554b565285e62c0824.zip
Merge pull request #2922 from anandolee/master
Use PyUnicode_AsEncodedString() instead of PyUnicode_AsEncodedObject()
-rw-r--r--python/google/protobuf/pyext/message.cc2
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".