[Python-checkins] r46514 - in python/trunk: Mac/Modules/dlg/_Dlgmodule.c Mac/Modules/dlg/dlgsupport.py Mac/Modules/file/_Filemodule.c Mac/Modules/file/filesupport.py Python/import.c
Jim Jewett
jimjjewett at gmail.com
Tue May 30 21:10:14 CEST 2006
Why didn't you use the Py_RETURN_NONE macro here? (I notice that you
did use it in your previous checkin, fixing the anti-leak in struct.)
-jJ
On 5/28/06, georg.brandl <python-checkins at python.org> wrote:
> Author: georg.brandl
> Date: Sun May 28 23:57:35 2006
> New Revision: 46514
>
> Modified:
> python/trunk/Mac/Modules/dlg/_Dlgmodule.c
> python/trunk/Mac/Modules/dlg/dlgsupport.py
> python/trunk/Mac/Modules/file/_Filemodule.c
> python/trunk/Mac/Modules/file/filesupport.py
> python/trunk/Python/import.c
> Log:
> Correct None refcount issue in Mac modules. (Are they
> still used?)
>
>
>
> Modified: python/trunk/Mac/Modules/dlg/_Dlgmodule.c
> ==============================================================================
> --- python/trunk/Mac/Modules/dlg/_Dlgmodule.c (original)
> +++ python/trunk/Mac/Modules/dlg/_Dlgmodule.c Sun May 28 23:57:35 2006
> @@ -139,7 +139,7 @@
> PyObject *DlgObj_New(DialogPtr itself)
> {
> DialogObject *it;
> - if (itself == NULL) return Py_None;
> + if (itself == NULL) { Py_INCREF(Py_None); return Py_None; }
> it = PyObject_NEW(DialogObject, &Dialog_Type);
> if (it == NULL) return NULL;
> it->ob_itself = itself;
>
> Modified: python/trunk/Mac/Modules/dlg/dlgsupport.py
> ==============================================================================
> --- python/trunk/Mac/Modules/dlg/dlgsupport.py (original)
> +++ python/trunk/Mac/Modules/dlg/dlgsupport.py Sun May 28 23:57:35 2006
> @@ -202,7 +202,7 @@
> Output("SetWRefCon(GetDialogWindow(itself), (long)it);")
>
> def outputCheckNewArg(self):
> - Output("if (itself == NULL) return Py_None;")
> + Output("if (itself == NULL) { Py_INCREF(Py_None); return Py_None; }")
>
> def outputCheckConvertArg(self):
> Output("if (v == Py_None) { *p_itself = NULL; return 1; }")
>
> Modified: python/trunk/Mac/Modules/file/_Filemodule.c
> ==============================================================================
> --- python/trunk/Mac/Modules/file/_Filemodule.c (original)
> +++ python/trunk/Mac/Modules/file/_Filemodule.c Sun May 28 23:57:35 2006
> @@ -153,7 +153,7 @@
> static PyObject *FSCatalogInfo_New(FSCatalogInfo *itself)
> {
> FSCatalogInfoObject *it;
> - if (itself == NULL) return Py_None;
> + if (itself == NULL) { Py_INCREF(Py_None); return Py_None; }
> it = PyObject_NEW(FSCatalogInfoObject, &FSCatalogInfo_Type);
> if (it == NULL) return NULL;
> it->ob_itself = *itself;
>
> Modified: python/trunk/Mac/Modules/file/filesupport.py
> ==============================================================================
> --- python/trunk/Mac/Modules/file/filesupport.py (original)
> +++ python/trunk/Mac/Modules/file/filesupport.py Sun May 28 23:57:35 2006
> @@ -475,7 +475,7 @@
> self.argref = "*" # Store FSSpecs, but pass them by address
>
> def outputCheckNewArg(self):
> - Output("if (itself == NULL) return Py_None;")
> + Output("if (itself == NULL) { Py_INCREF(Py_None); return Py_None; }")
>
> def output_tp_newBody(self):
> Output("PyObject *self;");
>
> Modified: python/trunk/Python/import.c
> ==============================================================================
> --- python/trunk/Python/import.c (original)
> +++ python/trunk/Python/import.c Sun May 28 23:57:35 2006
> @@ -2059,7 +2059,7 @@
> /* Return the package that an import is being performed in. If globals comes
> from the module foo.bar.bat (not itself a package), this returns the
> sys.modules entry for foo.bar. If globals is from a package's __init__.py,
> - the package's entry in sys.modules is returned.
> + the package's entry in sys.modules is returned, as a borrowed reference.
>
> The *name* of the returned package is returned in buf, with the length of
> the name in *p_buflen.
> _______________________________________________
> Python-checkins mailing list
> Python-checkins at python.org
> http://mail.python.org/mailman/listinfo/python-checkins
>
More information about the Python-checkins
mailing list