[Python-checkins] python/dist/src/Modules main.c,1.79,1.80

loewis at users.sourceforge.net loewis at users.sourceforge.net
Tue Nov 18 14:46:27 EST 2003


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv16426/Modules

Modified Files:
	main.c 
Log Message:
Patch #794400: Let PYTHONSTARTUP influence the compiler flags.


Index: main.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/main.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -C2 -d -r1.79 -r1.80
*** main.c	20 Oct 2003 14:01:53 -0000	1.79
--- main.c	18 Nov 2003 19:46:25 -0000	1.80
***************
*** 118,121 ****
--- 118,134 ----
  }
  
+ static void RunStartupFile(PyCompilerFlags *cf)
+ {
+ 	char *startup = Py_GETENV("PYTHONSTARTUP");
+ 	if (startup != NULL && startup[0] != '\0') {
+ 		FILE *fp = fopen(startup, "r");
+ 		if (fp != NULL) {
+ 			(void) PyRun_SimpleFileExFlags(fp, startup, 0, cf);
+ 			PyErr_Clear();
+ 			fclose(fp);
+ 		}
+ 	}
+ }
+ 
  
  /* Main program */
***************
*** 402,414 ****
  	else {
  		if (filename == NULL && stdin_is_interactive) {
! 			char *startup = Py_GETENV("PYTHONSTARTUP");
! 			if (startup != NULL && startup[0] != '\0') {
! 				FILE *fp = fopen(startup, "r");
! 				if (fp != NULL) {
! 					(void) PyRun_SimpleFile(fp, startup);
! 					PyErr_Clear();
! 					fclose(fp);
! 				}
! 			}
  		}
  		/* XXX */
--- 415,419 ----
  	else {
  		if (filename == NULL && stdin_is_interactive) {
! 			RunStartupFile(&cf);
  		}
  		/* XXX */





More information about the Python-checkins mailing list