Skip to content

Commit bd1a824

Browse files
committed
GR-14345: partial support for -I isolation mode
- todo: script dir still in path
1 parent cec2564 commit bd1a824

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

graalpython/com.oracle.graal.python.shell/src/com/oracle/graal/python/shell/GraalPythonMain.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public static void main(String[] args) {
6363
private ArrayList<String> programArgs = null;
6464
private String commandString = null;
6565
private String inputFile = null;
66+
private boolean ignoreScriptDir = false;
6667
private boolean ignoreEnv = false;
6768
private boolean inspectFlag = false;
6869
private boolean verboseFlag = false;
@@ -128,6 +129,11 @@ protected List<String> preprocessArguments(List<String> givenArgs, Map<String, S
128129
case "-q":
129130
quietFlag = true;
130131
break;
132+
case "-I":
133+
noUserSite = true;
134+
ignoreEnv = true;
135+
ignoreScriptDir = true;
136+
break;
131137
case "-s":
132138
noUserSite = true;
133139
break;
@@ -557,6 +563,7 @@ protected void printHelp(OptionCategory maxCategory) {
557563
// "-Q arg : division options: -Qold (default), -Qwarn, -Qwarnall, -Qnew\n"
558564
// +
559565
"-q : don't print version and copyright messages on interactive startup\n" +
566+
"-I : don't add user site and script directory to sys.path; also PYTHONNOUSERSITE\n" +
560567
"-s : don't add user site directory to sys.path; also PYTHONNOUSERSITE\n" +
561568
"-S : don't imply 'import site' on initialization\n" +
562569
// "-t : issue warnings about inconsistent tab usage (-tt: issue errors)\n"

0 commit comments

Comments
 (0)