Skip to content

Commit b01bd1b

Browse files
mkruskal-googlecopybara-github
authored andcommitted
Mark the python generator for editions support.
Editions has been implemented in all three implementations already, and this simply enables it. PiperOrigin-RevId: 582139104
1 parent fac9fdc commit b01bd1b

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/google/protobuf/compiler/python/generator.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ class PROTOC_EXPORT Generator : public CodeGenerator {
6666
std::string* error) const override;
6767

6868
uint64_t GetSupportedFeatures() const override {
69-
return Feature::FEATURE_PROTO3_OPTIONAL;
69+
return Feature::FEATURE_PROTO3_OPTIONAL |
70+
Feature::FEATURE_SUPPORTS_EDITIONS;
7071
}
7172
Edition GetMinimumEdition() const override { return Edition::EDITION_PROTO2; }
7273
Edition GetMaximumEdition() const override { return Edition::EDITION_2023; }

src/google/protobuf/compiler/python/pyi_generator.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ class PROTOC_EXPORT PyiGenerator : public google::protobuf::compiler::CodeGenera
4848
// CodeGenerator methods.
4949
uint64_t GetSupportedFeatures() const override {
5050
// Code generators must explicitly support proto3 optional.
51-
return CodeGenerator::FEATURE_PROTO3_OPTIONAL;
51+
return Feature::FEATURE_PROTO3_OPTIONAL |
52+
Feature::FEATURE_SUPPORTS_EDITIONS;
5253
}
5354
bool Generate(const FileDescriptor* file, const std::string& parameter,
5455
GeneratorContext* generator_context,

0 commit comments

Comments
 (0)