Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adhere to PEP 8 (#15127) #15729

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/google/protobuf/compiler/python/generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ bool Generator::Generate(const FileDescriptor* file,
PrintFileDescriptor();
printer_->Print("_globals = globals()\n");
if (GeneratingDescriptorProto()) {
printer_->Print("if _descriptor._USE_C_DESCRIPTORS == False:\n");
printer_->Print("if not _descriptor._USE_C_DESCRIPTORS:\n");
printer_->Indent();
// Create enums before message descriptors
PrintAllEnumsInFile();
Expand All @@ -322,7 +322,7 @@ bool Generator::Generate(const FileDescriptor* file,
"_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, '$module_name$', "
"_globals)\n",
"module_name", module_name);
printer.Print("if _descriptor._USE_C_DESCRIPTORS == False:\n");
printer.Print("if not _descriptor._USE_C_DESCRIPTORS:\n");
printer_->Indent();

// Descriptor options may have custom extensions. These custom options
Expand Down Expand Up @@ -549,7 +549,7 @@ void Generator::PrintFileDescriptor() const {
m["options"] = OptionsValue(proto_.options().SerializeAsString());
m["serialized_descriptor"] = absl::CHexEscape(file_descriptor_serialized_);
if (GeneratingDescriptorProto()) {
printer_->Print("if _descriptor._USE_C_DESCRIPTORS == False:\n");
printer_->Print("if not _descriptor._USE_C_DESCRIPTORS:\n");
printer_->Indent();
// Pure python's AddSerializedFile() depend on the generated
// descriptor_pb2.py thus we can not use AddSerializedFile() when
Expand Down