Skip to content

Commit 5fc5558

Browse files
committed
Raise warnings for deprecated python cpp extension GetDebugString().
Pure python and upb do not support it and filtered out the test. This API does not exists in any other language(except protobuf c++). GetDebugString() for cpp extension will be removed in Jan 2025 PiperOrigin-RevId: 662640110
1 parent 40b5bda commit 5fc5558

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)