]> granicus.if.org Git - python/commitdiff
Issue #18327: Fix argument order in call to compatible_for_assignment(oldto, newto...
authorChristian Heimes <christian@cheimes.de>
Sat, 20 Jul 2013 12:19:46 +0000 (14:19 +0200)
committerChristian Heimes <christian@cheimes.de>
Sat, 20 Jul 2013 12:19:46 +0000 (14:19 +0200)
The fix only affects the error message of __class__ assignment. CID 983564

Objects/typeobject.c

index 0eea38443f0c9c1b0ba853522ccd0d14aa58c2bc..b8b5076c1d87c55c4ca6e4f86bb99bce2ad57687 100644 (file)
@@ -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);