Skip to content

Commit

Permalink
Adhere to PEP 8 (#15127) (#15729)
Browse files Browse the repository at this point in the history
Fix #14528

Closes #15127

COPYBARA_INTEGRATE_REVIEW=#15127 from vyq:main 0c1f01c
PiperOrigin-RevId: 603092749

Co-authored-by: vyq <sheng8@gatech.edu>
  • Loading branch information
zhangskz and vyq committed Feb 5, 2024
1 parent ab6bcba commit 3b92f4f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/google/protobuf/compiler/python/generator.cc
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

0 comments on commit 3b92f4f

Please sign in to comment.