diff options
Diffstat (limited to 'Modules/main.c')
-rw-r--r-- | Modules/main.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Modules/main.c b/Modules/main.c index 0fd59c9..27b8493 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -45,7 +45,7 @@ static wchar_t **orig_argv; static int orig_argc; /* command line options */ -#define BASE_OPTS L"bBc:dEhiJm:OStuvVW:xX?" +#define BASE_OPTS L"bBc:dEhiJm:OsStuvVW:xX?" #define PROGRAM_OPTS BASE_OPTS @@ -70,6 +70,7 @@ static char *usage_2 = "\ -m mod : run library module as a script (terminates option list)\n\ -O : optimize generated bytecode slightly; also PYTHONOPTIMIZE=x\n\ -OO : remove doc-strings in addition to the -O optimizations\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\ "; @@ -355,6 +356,10 @@ Py_Main(int argc, wchar_t **argv) Py_DontWriteBytecodeFlag++; break; + case 's': + Py_NoUserSiteDirectory++; + break; + case 'S': Py_NoSiteFlag++; break; @@ -419,6 +424,10 @@ Py_Main(int argc, wchar_t **argv) (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 && wcscmp(argv[_PyOS_optind], L"-") != 0) { |