diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-03-09 05:58:11 +0000 |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-03-09 05:58:11 +0000 |
commit | 72c2c062d71c499863ff6e260525faaea4a53dbb (patch) | |
tree | a93e5551c95aff7b117588fa91465a9b15558d45 /Python/sysmodule.c | |
parent | 8ff212034e3386916f1a35ff3b0c955aa1ea2b4a (diff) | |
download | cpython-git-72c2c062d71c499863ff6e260525faaea4a53dbb.tar.gz |
Try to be a bit more consistent on all platforms:
python .
python < .
both print a message, return non-zero and do not core dump.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r-- | Python/sysmodule.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 6eadd06d9c..dfa6ac84d9 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -1037,7 +1037,10 @@ _PySys_Init(void) struct stat sb; if (fstat(fileno(stdin), &sb) == 0 && S_ISDIR(sb.st_mode)) { - Py_FatalError("<stdin> is a directory"); + /* There's nothing more we can do. */ + /* Py_FatalError() will core dump, so just exit. */ + PySys_WriteStderr("Python error: <stdin> is a directory, cannot continue\n"); + exit(EXIT_FAILURE); } } |