[Python-checkins] python/dist/src/Mac/Python macmain.c,1.76,1.77

jackjansen@sourceforge.net jackjansen@sourceforge.net
Sun, 14 Apr 2002 13:12:42 -0700


Update of /cvsroot/python/python/dist/src/Mac/Python
In directory usw-pr-cvs1:/tmp/cvs-serv1748/Mac/Python

Modified Files:
	macmain.c 
Log Message:
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. 


Index: macmain.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Python/macmain.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -C2 -d -r1.76 -r1.77
*** macmain.c	11 Apr 2002 20:48:08 -0000	1.76
--- macmain.c	14 Apr 2002 20:12:40 -0000	1.77
***************
*** 612,616 ****
  	
  	if (filename != NULL) {
! 		if ((fp = fopen(filename, "r")) == NULL) {
  			fprintf(stderr, "%s: can't open file '%s'\n",
  				argv[0], filename);
--- 612,616 ----
  	
  	if (filename != NULL) {
! 		if ((fp = fopen(filename, "r" PY_STDIOTEXTMODE)) == NULL) {
  			fprintf(stderr, "%s: can't open file '%s'\n",
  				argv[0], filename);
***************
*** 631,635 ****
  
  	if (filename == NULL && isatty((int)fileno(fp))) {
! 		FILE *fp = fopen(STARTUP, "r");
  		if (fp != NULL) {
  			(void) PyRun_SimpleFile(fp, STARTUP);
--- 631,635 ----
  
  	if (filename == NULL && isatty((int)fileno(fp))) {
! 		FILE *fp = fopen(STARTUP, "r" PY_STDIOTEXTMODE);
  		if (fp != NULL) {
  			(void) PyRun_SimpleFile(fp, STARTUP);