Commit 69bfde22 authored by Jie Luo's avatar Jie Luo Committed by GitHub

Merge pull request #2922 from anandolee/master

Use PyUnicode_AsEncodedString() instead of PyUnicode_AsEncodedObject()
parents 139fd0a1 c348d46a
......@@ -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".
......
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