From add4d92f050fb11d3901c6f0ee579a122d4a7a98 Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Tue, 5 Jan 2021 19:13:21 +0000 Subject: [PATCH] A temporary protobuf patch (#4907) Co-authored-by: Ivan Levkivskyi --- third_party/2and3/google/protobuf/struct_pb2.pyi | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/third_party/2and3/google/protobuf/struct_pb2.pyi b/third_party/2and3/google/protobuf/struct_pb2.pyi index 57028561f..6c555a0d3 100644 --- a/third_party/2and3/google/protobuf/struct_pb2.pyi +++ b/third_party/2and3/google/protobuf/struct_pb2.pyi @@ -27,6 +27,7 @@ from google.protobuf.message import ( ) from typing import ( + Any, Iterable as typing___Iterable, Mapping as typing___Mapping, NewType as typing___NewType, @@ -50,7 +51,11 @@ DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ... NullValueValue = typing___NewType('NullValueValue', builtin___int) type___NullValueValue = NullValueValue -NullValue: _NullValue + +# We temporary set this to Any to simplify mypy-protobuf migration, +# replace with `NullValue: _NullValue` after mypy-protobuf 1.24 is out. +NullValue = Any + class _NullValue(google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper[NullValueValue]): DESCRIPTOR: google___protobuf___descriptor___EnumDescriptor = ... NULL_VALUE = typing___cast(NullValueValue, 0)