Try to be a bit more consistent on all platforms:

python .
  python < .

both print a message, return non-zero and do not core dump.
This commit is contained in:
Neal Norwitz 2006-03-09 05:58:11 +00:00
parent 8ff212034e
commit 72c2c062d7
3 changed files with 8 additions and 15 deletions

View file

@ -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);
}
}