From 97c935a3fe372c99b25ecad5b09f8097178415ee Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Mon, 19 Sep 2022 01:47:36 +0100 Subject: [PATCH] Fix protobuf stubtest errors (#8758) --- stubs/protobuf/@tests/stubtest_allowlist.txt | 4 +++- stubs/protobuf/google/protobuf/reflection.pyi | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/stubs/protobuf/@tests/stubtest_allowlist.txt b/stubs/protobuf/@tests/stubtest_allowlist.txt index 924b14694..84bc2613d 100644 --- a/stubs/protobuf/@tests/stubtest_allowlist.txt +++ b/stubs/protobuf/@tests/stubtest_allowlist.txt @@ -25,10 +25,12 @@ google.protobuf.text_format.MessageToBytes google.protobuf.service.Service.GetDescriptor # These are deliberately omitted in the stub. -# The classes also can't be constructed directly anyway, +# The classes 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. diff --git a/stubs/protobuf/google/protobuf/reflection.pyi b/stubs/protobuf/google/protobuf/reflection.pyi index d32a93dc0..4bfbd2f4c 100644 --- a/stubs/protobuf/google/protobuf/reflection.pyi +++ b/stubs/protobuf/google/protobuf/reflection.pyi @@ -1,6 +1,6 @@ class GeneratedProtocolMessageType(type): def __new__(cls, name, bases, dictionary): ... - def __init__(cls, name, bases, dictionary) -> None: ... + def __init__(__self, name, bases, dictionary) -> None: ... def ParseMessage(descriptor, byte_str): ... def MakeClass(descriptor): ...