mirror of https://github.com/python/cpython
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
This commit is contained in:
parent
abfc4d838a
commit
de4d183955
|
@ -3338,7 +3338,7 @@ object_set_class(PyObject *self, PyObject *value, void *closure)
|
||||||
"__class__ assignment: only for heap types");
|
"__class__ assignment: only for heap types");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (compatible_for_assignment(newto, oldto, "__class__")) {
|
if (compatible_for_assignment(oldto, newto, "__class__")) {
|
||||||
Py_INCREF(newto);
|
Py_INCREF(newto);
|
||||||
Py_TYPE(self) = newto;
|
Py_TYPE(self) = newto;
|
||||||
Py_DECREF(oldto);
|
Py_DECREF(oldto);
|
||||||
|
|
Loading…
Reference in New Issue