Kaydet (Commit) de4d1839 authored tarafından Christian Heimes's avatar Christian Heimes

Issue #18327: Fix argument order in call to compatible_for_assignment(oldto, newto, attr).

The fix only affects the error message of __class__ assignment. CID 983564
üst abfc4d83
......@@ -3338,7 +3338,7 @@ object_set_class(PyObject *self, PyObject *value, void *closure)
"__class__ assignment: only for heap types");
return -1;
}
if (compatible_for_assignment(newto, oldto, "__class__")) {
if (compatible_for_assignment(oldto, newto, "__class__")) {
Py_INCREF(newto);
Py_TYPE(self) = newto;
Py_DECREF(oldto);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment