Re: [Pyobjc-dev] PyObjC 1.1b1 released
Brought to you by:
ronaldoussoren
From: Pierce T. W. I. <pi...@tw...> - 2004-02-23 21:23:35
|
On Feb 23, 2004, at 2:08 PM, Ronald Oussoren wrote: > > On 23-feb-04, at 20:32, Pierce T. Wetter III wrote: > >> >> On Feb 21, 2004, at 1:03 PM, Ronald Oussoren wrote: >> >>> I've just pushed release 1.1b1 to the website. >> >> What could I do to convince you to add the >> >> [obj self] >> >> call to the release? Its the only change I have left to make pyobjc >> work well with EOF 4.5, and while its a no-op for non-EOF objects, >> its necessary to trigger faults before converting to a pyobj. Its >> really annoying to have to distribute a custom version to our >> developers. > > In august 2003, Pierce wrote: > >> I found one spot: >> >> Changing >> >> #define PyObjCObject_GetObject(object) >> (((PyObjCObject*)(object))->objc_object) >> >> to >> >> #define PyObjCObject_GetObject(object) >> ([((PyObjCObject*)(object))->objc_object self]) >> >> in pyobjc.h seems to do it. > > Are you still using this patch? > > If so, could you try if adding 'objc_object = [objc_object self]' just > below the code below (in Modules/objc/objc-object.m, line 712, in > function PyObjCObject_New) also works? > > res = find_existing_proxy(objc_object); > if (res) return res; > > If I recall the issues correctly this should convert any "ghost" > objects to real objects before passing them to python. This reduces > the changes of confusing the bridge w.r.t. the patch above. > > A simular change might be needed in PyObjCObject_NewUnitialized, that > function is only called for the result of +alloc and probably doesn't > need changing. > > I'll add this to the bridge if this solves your problems with EOF (and > doesn't introduce new problems). The only change I have from HEAD right now is in objc_support.m, where: PyObject * pythonify_c_value (const char *type, void *datum) . . code omittted . case _C_ID: { id obj = *(id *) datum; if (obj == nil) { retobject = Py_None; Py_INCREF (retobject); } else { retobject = [obj __pyobjc_PythonObject__]; } break; } became: PyObject * pythonify_c_value (const char *type, void *datum) . . code omittted . case _C_ID: { id obj = *(id *) datum; obj=[obj self]; <----- added call if (obj == nil) { retobject = Py_None; Py_INCREF (retobject); } else { retobject = [obj __pyobjc_PythonObject__]; } break; } So its just that one line in that one place. Pierce |