summaryrefslogtreecommitdiff
path: root/Python/dynload_shlib.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-03-30 10:09:31 +0200
committerVictor Stinner <victor.stinner@gmail.com>2015-03-30 10:09:31 +0200
commit0600ebc4d9a0fbb0f16689fb2c1d6a09482594cc (patch)
tree344429f0f5a016baea2bcd0c5b5952cccdcef942 /Python/dynload_shlib.c
parent881f3319420fd3195c53cc5609808cd6e612837a (diff)
downloadcpython-0600ebc4d9a0fbb0f16689fb2c1d6a09482594cc.tar.gz
Issue #23752: _Py_fstat() is now responsible to raise the Python exception
Add _Py_fstat_noraise() function when a Python exception is not welcome.
Diffstat (limited to 'Python/dynload_shlib.c')
-rw-r--r--Python/dynload_shlib.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c
index 659adace09..1a467fde7c 100644
--- a/Python/dynload_shlib.c
+++ b/Python/dynload_shlib.c
@@ -71,22 +71,20 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *shortname,
if (fp != NULL) {
int i;
- struct _Py_stat_struct statb;
- if (_Py_fstat(fileno(fp), &statb) == -1) {
- PyErr_SetFromErrno(PyExc_IOError);
+ struct _Py_stat_struct status;
+ if (_Py_fstat(fileno(fp), &status) == -1)
return NULL;
- }
for (i = 0; i < nhandles; i++) {
- if (statb.st_dev == handles[i].dev &&
- statb.st_ino == handles[i].ino) {
+ if (status.st_dev == handles[i].dev &&
+ status.st_ino == handles[i].ino) {
p = (dl_funcptr) dlsym(handles[i].handle,
funcname);
return p;
}
}
if (nhandles < 128) {
- handles[nhandles].dev = statb.st_dev;
- handles[nhandles].ino = statb.st_ino;
+ handles[nhandles].dev = status.st_dev;
+ handles[nhandles].ino = status.st_ino;
}
}