Skip to content

Commit

Permalink
Deprecated APIs that add non top descriptors to pool will be removed …
Browse files Browse the repository at this point in the history
…soon

PiperOrigin-RevId: 529840421
  • Loading branch information
anandolee authored and copybara-github committed May 5, 2023
1 parent 8a44369 commit 3f5d844
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions python/google/protobuf/descriptor_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def _Deprecated(func):
def NewFunc(*args, **kwargs):
warnings.warn(
'Call to deprecated function %s(). Note: Do add unlinked descriptors '
'to descriptor_pool is wrong. Use Add() or AddSerializedFile() '
'instead.' % func.__name__,
'to descriptor_pool is wrong. Please use Add() or AddSerializedFile() '
'instead. This function will be removed soon.' % func.__name__,
category=DeprecationWarning)
return func(*args, **kwargs)
NewFunc.__name__ = func.__name__
Expand Down Expand Up @@ -246,12 +246,6 @@ def _AddDescriptor(self, desc):
self._descriptors[desc.full_name] = desc
self._AddFileDescriptor(desc.file)

# Add EnumDescriptor to descriptor pool is deprecated. Please use Add()
# or AddSerializedFile() to add a FileDescriptorProto instead.
@_Deprecated
def AddEnumDescriptor(self, enum_desc):
self._AddEnumDescriptor(enum_desc)

# Never call this method. It is for internal usage only.
def _AddEnumDescriptor(self, enum_desc):
"""Adds an EnumDescriptor to the pool.
Expand Down

0 comments on commit 3f5d844

Please sign in to comment.