mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +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
|
@ -753,9 +753,11 @@ Py_Main(int argc, wchar_t **argv)
|
|||
}
|
||||
{
|
||||
struct _Py_stat_struct sb;
|
||||
if (_Py_fstat(fileno(fp), &sb) == 0 &&
|
||||
if (_Py_fstat_noraise(fileno(fp), &sb) == 0 &&
|
||||
S_ISDIR(sb.st_mode)) {
|
||||
fprintf(stderr, "%ls: '%ls' is a directory, cannot continue\n", argv[0], filename);
|
||||
fprintf(stderr,
|
||||
"%ls: '%ls' is a directory, cannot continue\n",
|
||||
argv[0], filename);
|
||||
fclose(fp);
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue