Skip to content

Commit d6d4c73

Browse files
committed
Always return type version from analyze_descriptor_load
This matches the previous implementation and causes failures to specialize due to the presence of both __getattr__ and __getattribute__ to be classified correctly (rather than being classified as being out of type versions).
1 parent b868363 commit d6d4c73

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Python/specialize.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,7 @@ analyze_descriptor_load(PyTypeObject *type, PyObject *name, PyObject **descr, un
921921
Too complicated */
922922
Py_DECREF(getattribute);
923923
*descr = NULL;
924+
*tp_version = ga_version;
924925
return GETSET_OVERRIDDEN;
925926
}
926927
/* Potentially has __getattr__ but no custom __getattribute__.
@@ -934,6 +935,7 @@ analyze_descriptor_load(PyTypeObject *type, PyObject *name, PyObject **descr, un
934935
}
935936
else {
936937
*descr = NULL;
938+
*tp_version = FT_ATOMIC_LOAD_UINT_RELAXED(type->tp_version_tag);
937939
return GETSET_OVERRIDDEN;
938940
}
939941
unsigned int descr_version;

0 commit comments

Comments
 (0)