summaryrefslogtreecommitdiffstats
path: root/Modules/main.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-05-06 23:45:46 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-05-06 23:45:46 (GMT)
commit8dc226fccd2183670ac19a85b89941f5b05167dc (patch)
treea02b3f53c54d1e18139d53de40954828350fabcb /Modules/main.c
parent1bf7108fd515af1b537dcbf738c3cb488af5ab0d (diff)
downloadcpython-8dc226fccd2183670ac19a85b89941f5b05167dc.zip
cpython-8dc226fccd2183670ac19a85b89941f5b05167dc.tar.gz
cpython-8dc226fccd2183670ac19a85b89941f5b05167dc.tar.bz2
Merged revisions 62774-62775,62785,62787-62788 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r62774 | georg.brandl | 2008-05-06 19:11:42 +0200 (Tue, 06 May 2008) | 2 lines #2773: fix description of 'g' and 'G' formatting spec. ........ r62775 | georg.brandl | 2008-05-06 19:20:54 +0200 (Tue, 06 May 2008) | 2 lines > != (!<). ........ r62785 | benjamin.peterson | 2008-05-07 00:18:11 +0200 (Wed, 07 May 2008) | 2 lines Fix logic error in Python/_warnings.c and add a test to verify ........ r62787 | benjamin.peterson | 2008-05-07 00:31:52 +0200 (Wed, 07 May 2008) | 2 lines Make the Python implementation of warnings compatible with the C implementation regarding non-callable showwarning ........ r62788 | christian.heimes | 2008-05-07 00:41:46 +0200 (Wed, 07 May 2008) | 1 line Implemented PEP 370 ........
Diffstat (limited to 'Modules/main.c')
-rw-r--r--Modules/main.c11
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)
{