Skip to content

Commit c6964f6

Browse files
authored
Merge pull request #17806 from anandolee/28.x
Raise warnings for deprecated python cpp extension GetDebugString().
2 parents 40b5bda + 5fc5558 commit c6964f6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

python/google/protobuf/pyext/descriptor.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,6 +1508,11 @@ static int SetHasOptions(PyFileDescriptor *self, PyObject *value,
15081508
}
15091509

15101510
static PyObject* GetDebugString(PyFileDescriptor* self) {
1511+
PyErr_Warn(nullptr,
1512+
"GetDebugString() API is deprecated. This API only "
1513+
"exists in protobuf c++ and does not exists in pure python, upb "
1514+
"or any other languages. GetDebugString() for python cpp "
1515+
"extension will be removed in Jan 2025");
15111516
return PyString_FromCppString(_GetDescriptor(self)->DebugString());
15121517
}
15131518

0 commit comments

Comments
 (0)