Skip to content

Commit 20b3352

Browse files
add back METHOD to the switch-case to avoid warnings
1 parent b0e5b6b commit 20b3352

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Python/specialize.c

+6-7
Original file line numberDiff line numberDiff line change
@@ -679,19 +679,18 @@ _Py_Specialize_LoadAttr(PyObject *owner, _Py_CODEUNIT *instr, PyObject *name)
679679
PyObject *descr = NULL;
680680
DescriptorClassification kind = analyze_descriptor(type, name, &descr, 0);
681681
assert(descr != NULL || kind == ABSENT || kind == GETSET_OVERRIDDEN);
682-
if (kind == METHOD) {
683-
if (oparg & 1) {
684-
if (specialize_attr_loadmethod(owner, instr, name, descr, kind)) {
685-
goto success;
686-
}
682+
if ((oparg & 1) && kind == METHOD) {
683+
if (specialize_attr_loadmethod(owner, instr, name, descr, kind)) {
684+
goto success;
687685
}
688-
SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_ATTR_METHOD);
689-
goto fail;
690686
}
691687
switch(kind) {
692688
case OVERRIDING:
693689
SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_ATTR_OVERRIDING_DESCRIPTOR);
694690
goto fail;
691+
case METHOD:
692+
SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_ATTR_METHOD);
693+
goto fail;
695694
case PROPERTY:
696695
SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_ATTR_PROPERTY);
697696
goto fail;

0 commit comments

Comments
 (0)