Commits

Ronald Oussoren  committed 83f618d

Calls to class-methods from ObjC didn't work due to a missing registration
call in objc_class.__new__.

  • Participants
  • Parent commits 4572ace
  • Branches pyobjc-ancient

Comments (0)

Files changed (2)

File Lib/objc/test/test_regr.py

         v = o.compP_aRect_anOp_((1,2), ((3,4),(5,6)), 7)
         self.assertEquals(v, u"aP:{1, 2} aR:{{3, 4}, {5, 6}} anO:7")
 
+    def testInitialize(self):
+        calls=[]
+        class InitializeTestClass (NSObject):
+            def initialize(self):
+                calls.append(repr(self))
+
+        self.assertEquals(len(calls), 0)
+        o = InitializeTestClass.new()
+        self.assertEquals(len(calls), 1)
+        o = InitializeTestClass.new()
+        self.assertEquals(len(calls), 1)
+
 if __name__ == '__main__':
     unittest.main()

File Modules/objc/objc-class.m

 			}
 		}
 	}
+
+	PyObjC_RegisterPythonProxy(objc_class, res);
 	Py_DECREF(keys);
 	Py_DECREF(old_dict);