[Python-Dev] [Python-checkins] cpython (3.3): return NULL here (original) (raw)

Benjamin Peterson benjamin at python.org
Tue Jul 23 17:10:40 CEST 2013


2013/7/23 Christian Heimes <christian at python.org>:

Am 23.07.2013 07:08, schrieb benjamin.peterson:

http://hg.python.org/cpython/rev/042ff9325c5e changeset: 84804:042ff9325c5e branch: 3.3 parent: 84789:bb63f813a00f user: Benjamin Peterson <benjamin at python.org> date: Mon Jul 22 22:08:09 2013 -0700 summary: return NULL here

files: Python/dynloadshlib.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/Python/dynloadshlib.c b/Python/dynloadshlib.c --- a/Python/dynloadshlib.c +++ b/Python/dynloadshlib.c @@ -91,7 +91,8 @@ int i; struct stat statb; if (fstat(fileno(fp), &statb) == -1) { - return PyErrSetFromErrno(PyExcIOError); + PyErrSetFromErrno(PyExcIOError); + return NULL; } PyErrSetFromErrno() already and always returns NULL. Or do you prefer to return NULL explicitly?

It might always return NULL, but the compiler sees (PyObject *)NULL when this function returns dl_funcptr.

-- Regards, Benjamin



More information about the Python-Dev mailing list