Skip to content

Commit

Permalink
Fix wrong warning message info
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 554629697
  • Loading branch information
anandolee authored and copybara-github committed Aug 7, 2023
1 parent fde357d commit 1619890
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions python/google/protobuf/internal/python_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -1364,8 +1364,8 @@ def _Clear(self):
def _UnknownFields(self):
warnings.warn(
'message.UnknownFields() is deprecated. Please use the add one '
'feature message_factory.UnknownFieldSet(message) in '
'message_factory.py instead.'
'feature unknown_fields.UnknownFieldSet(message) in '
'unknown_fields.py instead.'
)
if self._unknown_field_set is None: # pylint: disable=protected-access
# pylint: disable=protected-access
Expand Down
4 changes: 2 additions & 2 deletions python/google/protobuf/pyext/message.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2370,8 +2370,8 @@ static PyObject* GetExtensionDict(CMessage* self, void *closure) {
static PyObject* GetUnknownFields(CMessage* self) {
PyErr_Warn(nullptr,
"message.UnknownFields() is deprecated. Please use the "
"add one feature message_factory.UnknownFieldSet(message) in "
"message_factory.py instead.");
"add one feature unknown_fields.UnknownFieldSet(message) in "
"unknown_fields.py instead.");
if (self->unknown_field_set == nullptr) {
self->unknown_field_set = unknown_fields::NewPyUnknownFields(self);
} else {
Expand Down

0 comments on commit 1619890

Please sign in to comment.