@@ -57,15 +57,9 @@ namespace operations_research {
5757%typemap(argout) CppType* const , CppType* {
5858 std::string encoded_protobuf;
5959 $1 ->SerializeToString (&encoded_protobuf);
60- #if defined(PY3)
6160 PyObject* const python_encoded_protobuf =
6261 PyBytes_FromStringAndSize (encoded_protobuf.c_str (),
6362 encoded_protobuf.size ());
64- #else // PY3
65- PyObject* const python_encoded_protobuf =
66- PyString_FromStringAndSize (encoded_protobuf.c_str (),
67- encoded_protobuf.size ());
68- #endif // PY3
6963 if (python_encoded_protobuf != nullptr ) {
7064 PyObject* const result = PyObject_CallMethod (
7165 $input, const_cast <char *>(" ParseFromString" ),
@@ -84,13 +78,8 @@ namespace operations_research {
8478 if (clss != nullptr ) {
8579 std::string encoded_protobuf;
8680 $1 .SerializeToString (&encoded_protobuf);
87- #if defined(PY3)
8881 PyObject* const python_encoded_protobuf = PyBytes_FromStringAndSize (
8982 encoded_protobuf.c_str (), encoded_protobuf.size ());
90- #else // PY3
91- PyObject* const python_encoded_protobuf = PyString_FromStringAndSize (
92- encoded_protobuf.c_str (), encoded_protobuf.size ());
93- #endif // PY3
9483 PyObject* const result = PyObject_CallMethod (
9584 clss, const_cast <char *>(" FromString" ),
9685 const_cast <char *>(" (O)" ),
0 commit comments