Skip to content

Commit 0c1f01c

Browse files
author
vyq
committed
Adhere to PEP 8
1 parent dc9d387 commit 0c1f01c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ bool Generator::Generate(const FileDescriptor* file,
295295
PrintFileDescriptor();
296296
printer_->Print("_globals = globals()\n");
297297
if (GeneratingDescriptorProto()) {
298-
printer_->Print("if _descriptor._USE_C_DESCRIPTORS == False:\n");
298+
printer_->Print("if not _descriptor._USE_C_DESCRIPTORS:\n");
299299
printer_->Indent();
300300
// Create enums before message descriptors
301301
PrintAllEnumsInFile();
@@ -322,7 +322,7 @@ bool Generator::Generate(const FileDescriptor* file,
322322
"_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, '$module_name$', "
323323
"_globals)\n",
324324
"module_name", module_name);
325-
printer.Print("if _descriptor._USE_C_DESCRIPTORS == False:\n");
325+
printer.Print("if not _descriptor._USE_C_DESCRIPTORS:\n");
326326
printer_->Indent();
327327

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

0 commit comments

Comments
 (0)