From 81460c6abb2e068f27d44eca58640364793b133f Mon Sep 17 00:00:00 2001 From: Aaron Okano Date: Mon, 4 Jul 2022 03:54:33 +0000 Subject: [PATCH] pw_protobuf: update to use typing module for Set I'm not a python expert, but our build was failing due to python being confused about the syntax "set[str]". I'm guessing support for this was added in some later version of python, but ours (3.7) doesn't seem to support it, so this change updates it to import Set from the typing module and use that instead. Change-Id: I59435bab9375f70adb1053eb6709f3cea1336cd8 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/100720 Commit-Queue: Aaron Okano Reviewed-by: Ted Pudlik --- pw_protobuf/py/pw_protobuf/symbol_name_mapping.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pw_protobuf/py/pw_protobuf/symbol_name_mapping.py b/pw_protobuf/py/pw_protobuf/symbol_name_mapping.py index dd86180ea8..0921473d6f 100755 --- a/pw_protobuf/py/pw_protobuf/symbol_name_mapping.py +++ b/pw_protobuf/py/pw_protobuf/symbol_name_mapping.py @@ -14,13 +14,15 @@ # the License. """Fixes identifiers that would cause compiler errors in generated C++ code.""" +from typing import Set + # Set of words that can't be used as identifiers in the generated code. Many of # these are valid identifiers in proto syntax, but they need special handling in # the generated C++ code. # # Note: This is primarily used for "if x in y" operations, hence the use of a # set rather than a list. -PW_PROTO_CODEGEN_RESERVED_WORDS: set[str] = { +PW_PROTO_CODEGEN_RESERVED_WORDS: Set[str] = { # Identifiers that conflict with the codegen internals when used in certain # contexts: "Fields",