aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Abel <22837557+uael@users.noreply.github.com>2023-11-05 22:54:39 -0800
committerLucas Abel <22837557+uael@users.noreply.github.com>2023-11-05 23:20:51 -0800
commitb3825537144f24a60446cc25e1a6dd98c9c791eb (patch)
tree946c41da57bb9081359cc585ddd6b136e6ee2dab
parent90eeecd31fd84788fa04f736468b19005bcbd29d (diff)
downloadbt-test-interfaces-b3825537144f24a60446cc25e1a6dd98c9c791eb.tar.gz
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
-rwxr-xr-xpython/_build/protoc-gen-custom_grpc6
1 files 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], []))