From: Christian Heimes Date: Sat, 20 Jul 2013 12:19:46 +0000 (+0200) Subject: Issue #18327: Fix argument order in call to compatible_for_assignment(oldto, newto... X-Git-Tag: v3.4.0a1~137 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=de4d1839553cd967745f67c2de7c125587185bd4;p=python 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 --- diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 0eea38443f..b8b5076c1d 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -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);