protobuf: fix stubtest errors (#8735)

This commit is contained in:
Alex Waygood
2022-09-15 05:45:29 +01:00
committed by GitHub
parent 205901e2fd
commit 246f7e7720
2 changed files with 2 additions and 5 deletions

View File

@@ -24,14 +24,11 @@ google.protobuf.text_format.MessageToBytes
# a function. Typeshed's typing is more useful
google.protobuf.service.Service.GetDescriptor
# These are deliberately omitted in the stub
# due to the fact that these classes have conflicting signatures for __init__/__new__.
# These are deliberately omitted in the stub.
# The classes also can't be constructed directly anyway,
# so the signatures of their constructors are somewhat irrelevant.
google.protobuf.descriptor.Descriptor.__init__
google.protobuf.descriptor.Descriptor.__new__
google.protobuf.descriptor.ServiceDescriptor.__init__
google.protobuf.descriptor.ServiceDescriptor.__new__
# Set to None at runtime - which doesn't match the Sequence base class.
# It's a hack - just allow it.

View File

@@ -1,6 +1,6 @@
class GeneratedProtocolMessageType(type):
def __new__(cls, name, bases, dictionary): ...
def __init__(self, name, bases, dictionary) -> None: ...
def __init__(cls, name, bases, dictionary) -> None: ...
def ParseMessage(descriptor, byte_str): ...
def MakeClass(descriptor): ...