Commits

Lucian Brănescu-Mihăilă  committed 611e9d4

__getattribute__'s check if the current object is actually a class was reversed. After fixing that, I also added a check for python object.

  • Participants
  • Parent commits 5a7abaf

Comments (0)

Files changed (1)

File objects/src/type.winxed

         }
 
         // then attr on actual obj
-        if(id(cls) != id(t)) { // if obj is a class
+        if(id(cls) == id(t)) { // if obj is a class
             cry('obj is class');
             for(var i in get_mro(obj)) {
                 if(exists i.__dict__[key]) {
                     cry('getting from obj or parents');
                     var attr = i.__dict__[key];
 
-                    if(exists attr.__dict__['__get__']) {
-                        cry('using data descriptor');
-                        return attr.__dict__['__get__'](attr, obj);
-                    }
+                    // only for python objects
+                    if(typeof(attr) == 'Python;instance')
+                        if(exists attr.__dict__['__get__']) {
+                            cry('using data descriptor');
+                            return attr.__dict__['__get__'](attr, obj);
+                        }
 
                     return attr;
                 }