diff options
author | Christian Heimes <christian@cheimes.de> | 2008-05-06 22:41:46 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-05-06 22:41:46 (GMT) |
commit | af748c3ab8f4274a01630bc5dd95ede7db5f115b (patch) | |
tree | e37e8b4349d0d92d5e4ad6e50cf611c454ec6028 /Modules | |
parent | 323c40d48c4c1661a18336af16c59bc279fda571 (diff) | |
download | cpython-af748c3ab8f4274a01630bc5dd95ede7db5f115b.zip cpython-af748c3ab8f4274a01630bc5dd95ede7db5f115b.tar.gz cpython-af748c3ab8f4274a01630bc5dd95ede7db5f115b.tar.bz2 |
Implemented PEP 370
Diffstat (limited to 'Modules')
-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 38b6223..3a8a5cb 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -40,7 +40,7 @@ static char **orig_argv; 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 @@ static char *usage_2 = "\ -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_Main(int argc, char **argv) Py_DontWriteBytecodeFlag++; break; + case 's': + Py_NoUserSiteDirectory++; + break; + case 'S': Py_NoSiteFlag++; break; @@ -431,6 +436,10 @@ Py_Main(int argc, char **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 && strcmp(argv[_PyOS_optind], "-") != 0) { |