summaryrefslogtreecommitdiffstats
path: root/Modules/main.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-03-30 08:09:31 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-03-30 08:09:31 (GMT)
commite134a7fe36652434c2ccffc4ebab2ec2031d1505 (patch)
tree9eea060bf19c856881f438860eb2abdbe41f2bdd /Modules/main.c
parent2e1c4e5db2894ec4322f917e9babc4e37dca9244 (diff)
downloadcpython-e134a7fe36652434c2ccffc4ebab2ec2031d1505.zip
cpython-e134a7fe36652434c2ccffc4ebab2ec2031d1505.tar.gz
cpython-e134a7fe36652434c2ccffc4ebab2ec2031d1505.tar.bz2
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 'Modules/main.c')
-rw-r--r--Modules/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/main.c b/Modules/main.c
index 74e512b..2a9ea28 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -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;
}