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:
Victor Stinner 2015-03-30 10:09:31 +02:00
parent 2e1c4e5db2
commit e134a7fe36
12 changed files with 89 additions and 57 deletions

View file

@ -1690,7 +1690,7 @@ _PySys_Init(void)
#if !defined(MS_WINDOWS)
{
struct _Py_stat_struct sb;
if (_Py_fstat(fileno(stdin), &sb) == 0 &&
if (_Py_fstat_noraise(fileno(stdin), &sb) == 0 &&
S_ISDIR(sb.st_mode)) {
/* There's nothing more we can do. */
/* Py_FatalError() will core dump, so just exit. */