Skip to content

Commit 90943da

Browse files
Automated Code Change
PiperOrigin-RevId: 781691789
1 parent 906ab5b commit 90943da

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/google/protobuf/pyext/extension_dict.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ PyObject* subscript(ExtensionDict* self, PyObject* key) {
118118
return nullptr;
119119
}
120120

121-
if (descriptor->label() != FieldDescriptor::LABEL_REPEATED &&
121+
if (!descriptor->is_repeated() &&
122122
descriptor->cpp_type() != FieldDescriptor::CPPTYPE_MESSAGE) {
123123
return cmessage::InternalGetScalar(self->parent->message, descriptor);
124124
}
@@ -130,7 +130,7 @@ PyObject* subscript(ExtensionDict* self, PyObject* key) {
130130
return iterator->second->AsPyObject();
131131
}
132132

133-
if (descriptor->label() != FieldDescriptor::LABEL_REPEATED &&
133+
if (!descriptor->is_repeated() &&
134134
descriptor->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
135135
// TODO: consider building the class on the fly!
136136
ContainerBase* sub_message =
@@ -142,7 +142,7 @@ PyObject* subscript(ExtensionDict* self, PyObject* key) {
142142
return sub_message->AsPyObject();
143143
}
144144

145-
if (descriptor->label() == FieldDescriptor::LABEL_REPEATED) {
145+
if (descriptor->is_repeated()) {
146146
if (descriptor->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
147147
// On the fly message class creation is needed to support the following
148148
// situation:

0 commit comments

Comments
 (0)