From b3825537144f24a60446cc25e1a6dd98c9c791eb Mon Sep 17 00:00:00 2001 From: Lucas Abel <22837557+uael@users.noreply.github.com> Date: Sun, 5 Nov 2023 22:54:39 -0800 Subject: Fix annotation error caused by type checking. go/pytype-faq#annotating-with-a-proto-enum-type-caused-a-runtime-error sponge: https://fusion2.corp.google.com/f3831b2b-9753-3396-8296-39c6b3840d12 Co-authored-by: yehtsohsin@google.com --- python/_build/protoc-gen-custom_grpc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/_build/protoc-gen-custom_grpc b/python/_build/protoc-gen-custom_grpc index 2071a65..7ba6a12 100755 --- a/python/_build/protoc-gen-custom_grpc +++ b/python/_build/protoc-gen-custom_grpc @@ -595,9 +595,9 @@ for file_name in _REQUEST.file_to_generate: content='def unwrap(x):\n assert x\n return x\n' )) - pyi_imports: List[str] = [] - grpc_imports: List[str] = ['import grpc'] - grpc_aio_imports: List[str] = ['import grpc', 'import grpc.aio'] + pyi_imports: List[str] = ['from __future__ import annotations'] + grpc_imports: List[str] = ['from __future__ import annotations', 'import grpc'] + grpc_aio_imports: List[str] = ['from __future__ import annotations', 'import grpc', 'import grpc.aio'] enums = '\n'.join(sum([generate_enum(pyi_imports, file, enum, _FILES) for enum in file.enum_type], [])) messages = '\n'.join(sum([generate_message(pyi_imports, file, message, _FILES) for message in file.message_type], [])) -- cgit v1.2.3