mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #23752: _Py_fstat() is now responsible to raise the Python exception
Add _Py_fstat_noraise() function when a Python exception is not welcome.
This commit is contained in:
parent
2e1c4e5db2
commit
e134a7fe36
12 changed files with 89 additions and 57 deletions
|
@ -1486,7 +1486,7 @@ static off_t
|
|||
getfilesize(FILE *fp)
|
||||
{
|
||||
struct _Py_stat_struct st;
|
||||
if (_Py_fstat(fileno(fp), &st) != 0)
|
||||
if (_Py_fstat_noraise(fileno(fp), &st) != 0)
|
||||
return -1;
|
||||
#if SIZEOF_OFF_T == 4
|
||||
else if (st.st_size >= INT_MAX)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue