Implemented PEP 370
diff --git a/Modules/main.c b/Modules/main.c
index 38b6223..3a8a5cb 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -40,7 +40,7 @@
static int orig_argc;
/* command line options */
-#define BASE_OPTS "3bBc:dEhiJm:OQ:StuUvVW:xX?"
+#define BASE_OPTS "3bBc:dEhiJm:OQ:sStuUvVW:xX?"
#ifndef RISCOS
#define PROGRAM_OPTS BASE_OPTS
@@ -72,6 +72,7 @@
-O : optimize generated bytecode slightly; also PYTHONOPTIMIZE=x\n\
-OO : remove doc-strings in addition to the -O optimizations\n\
-Q arg : division options: -Qold (default), -Qwarn, -Qwarnall, -Qnew\n\
+-s : don't add user site directory to sys.path; also PYTHONNOUSERSITE\n\
-S : don't imply 'import site' on initialization\n\
-t : issue warnings about inconsistent tab usage (-tt: issue errors)\n\
";
@@ -359,6 +360,10 @@
Py_DontWriteBytecodeFlag++;
break;
+ case 's':
+ Py_NoUserSiteDirectory++;
+ break;
+
case 'S':
Py_NoSiteFlag++;
break;
@@ -431,6 +436,10 @@
(p = Py_GETENV("PYTHONUNBUFFERED")) && *p != '\0')
unbuffered = 1;
+ if (!Py_NoUserSiteDirectory &&
+ (p = Py_GETENV("PYTHONNOUSERSITE")) && *p != '\0')
+ Py_NoUserSiteDirectory = 1;
+
if (command == NULL && module == NULL && _PyOS_optind < argc &&
strcmp(argv[_PyOS_optind], "-") != 0)
{