From 246f7e77206f2d9b76e35d9ef1de919ffcbef938 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Thu, 15 Sep 2022 05:45:29 +0100 Subject: [PATCH] protobuf: fix stubtest errors (#8735) --- stubs/protobuf/@tests/stubtest_allowlist.txt | 5 +---- stubs/protobuf/google/protobuf/reflection.pyi | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/stubs/protobuf/@tests/stubtest_allowlist.txt b/stubs/protobuf/@tests/stubtest_allowlist.txt index c6fec8b5f..924b14694 100644 --- a/stubs/protobuf/@tests/stubtest_allowlist.txt +++ b/stubs/protobuf/@tests/stubtest_allowlist.txt @@ -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. diff --git a/stubs/protobuf/google/protobuf/reflection.pyi b/stubs/protobuf/google/protobuf/reflection.pyi index 3ca50552a..d32a93dc0 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__(self, name, bases, dictionary) -> None: ... + def __init__(cls, name, bases, dictionary) -> None: ... def ParseMessage(descriptor, byte_str): ... def MakeClass(descriptor): ...