Skip to content

protobuf: Fix stubtest errors #8735

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions stubs/protobuf/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion stubs/protobuf/google/protobuf/reflection.pyi
Original file line number Diff line number Diff line change
@@ -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): ...