소스 검색

Merge pull request #2922 from anandolee/master

Use PyUnicode_AsEncodedString() instead of PyUnicode_AsEncodedObject()
Jie Luo 8 년 전
부모
커밋
69bfde22b6
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      python/google/protobuf/pyext/message.cc

+ 1 - 1
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".