Patch #794400: Let PYTHONSTARTUP influence the compiler flags.
diff --git a/Modules/main.c b/Modules/main.c
index 2cb2b64..91818e0 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -117,6 +117,19 @@
 	/*NOTREACHED*/
 }
 
+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 */
 
@@ -401,15 +414,7 @@
 	}
 	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);
-				}
-			}
+			RunStartupFile(&cf);
 		}
 		/* XXX */
 		sts = PyRun_AnyFileExFlags(