Adhere to PEP 8 (#15127)

Fix https://github.com/protocolbuffers/protobuf/issues/14528

Closes #15127

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/15127 from vyq:main 0c1f01c74d
PiperOrigin-RevId: 603092749
pull/15654/head
vyq 1 year ago committed by Copybara-Service
parent f929439ccd
commit 21ab7459ee
  1. 6
      src/google/protobuf/compiler/python/generator.cc

@ -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();
@ -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
@ -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

Loading…
Cancel
Save