diff Python/sysmodule.c @ 36910:91a9e2e31e93 legacy-trunk

Try to be a bit more consistent on all platforms: python . python < . both print a message, return non-zero and do not core dump.
author Neal Norwitz <nnorwitz@gmail.com>
date Thu, 09 Mar 2006 05:58:11 +0000
parents 9eb24f92a784
children 7ada16a14968 57b1ff138995
line wrap: on
line diff
--- a/Python/sysmodule.c	Thu Mar 09 02:20:05 2006 +0000
+++ b/Python/sysmodule.c	Thu Mar 09 05:58:11 2006 +0000
@@ -1037,7 +1037,10 @@
 		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);
 		}
 	}