diff Mac/Python/macmain.c @ 23029:8291473fde3e legacy-trunk

Mass checkin of universal newline support. Highlights: import and friends will understand any of \r, \n and \r\n as end of line. Python file input will do the same if you use mode 'U'. Everything can be disabled by configuring with --without-universal-newlines. See PEP278 for details.
author Jack Jansen <jack.jansen@cwi.nl>
date Sun, 14 Apr 2002 20:12:41 +0000
parents 5f2dcdd09329
children 7bc31ad9477c
line wrap: on
line diff
--- a/Mac/Python/macmain.c	Sun Apr 14 10:30:51 2002 +0000
+++ b/Mac/Python/macmain.c	Sun Apr 14 20:12:41 2002 +0000
@@ -611,7 +611,7 @@
 			Py_GetVersion(), Py_GetPlatform(), COPYRIGHT);
 	
 	if (filename != NULL) {
-		if ((fp = fopen(filename, "r")) == NULL) {
+		if ((fp = fopen(filename, "r" PY_STDIOTEXTMODE)) == NULL) {
 			fprintf(stderr, "%s: can't open file '%s'\n",
 				argv[0], filename);
 			PyMac_Exit(2);
@@ -630,7 +630,7 @@
 	PySys_SetArgv(argc, argv);
 
 	if (filename == NULL && isatty((int)fileno(fp))) {
-		FILE *fp = fopen(STARTUP, "r");
+		FILE *fp = fopen(STARTUP, "r" PY_STDIOTEXTMODE);
 		if (fp != NULL) {
 			(void) PyRun_SimpleFile(fp, STARTUP);
 			PyErr_Clear();