summaryrefslogtreecommitdiffstats
path: root/contrib/python
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/python')
-rw-r--r--contrib/python/protobuf/py3/google/protobuf/pyext/message.cc4
1 files changed, 0 insertions, 4 deletions
diff --git a/contrib/python/protobuf/py3/google/protobuf/pyext/message.cc b/contrib/python/protobuf/py3/google/protobuf/pyext/message.cc
index a9e464d7f95..291af9e817e 100644
--- a/contrib/python/protobuf/py3/google/protobuf/pyext/message.cc
+++ b/contrib/python/protobuf/py3/google/protobuf/pyext/message.cc
@@ -822,7 +822,6 @@ bool CheckAndSetString(
PyObject* ToStringObject(const FieldDescriptor* descriptor,
const TProtoStringType& value) {
-#if PY_MAJOR_VERSION >= 3
if (descriptor->type() != FieldDescriptor::TYPE_STRING) {
return PyBytes_FromStringAndSize(value.c_str(), value.length());
}
@@ -837,9 +836,6 @@ PyObject* ToStringObject(const FieldDescriptor* descriptor,
result = PyBytes_FromStringAndSize(value.c_str(), value.length());
}
return result;
-#else
- return PyBytes_FromStringAndSize(value.c_str(), value.length());
-#endif
}
bool CheckFieldBelongsToMessage(const FieldDescriptor* field_descriptor,