File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
graalpython/com.oracle.graal.python.shell/src/com/oracle/graal/python/shell Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -77,10 +77,10 @@ public static void main(String[] args) {
7777
7878 @ Override
7979 protected List <String > preprocessArguments (List <String > givenArgs , Map <String , String > polyglotOptions ) {
80- givenArguments = new ArrayList <>(givenArgs );
8180 ArrayList <String > unrecognized = new ArrayList <>();
8281 ArrayList <String > inputArgs = new ArrayList <>(getDefaultEnvironmentArgs ());
83- inputArgs .addAll (givenArguments );
82+ inputArgs .addAll (givenArgs );
83+ givenArguments = new ArrayList <>(inputArgs );
8484 List <String > arguments = new ArrayList <>(inputArgs );
8585 List <String > subprocessArgs = new ArrayList <>();
8686 programArgs = new ArrayList <>();
@@ -406,9 +406,15 @@ protected void launch(Builder contextBuilder) {
406406 }
407407
408408 private void setContextOptionIfUnset (Builder contextBuilder , String key , String value ) {
409- if (!givenArguments .contains ("--" + key ) && System .getProperty ("polyglot." + key ) == null ) {
410- contextBuilder .option (key , value );
409+ if (System .getProperty ("polyglot." + key ) != null ) {
410+ return ;
411+ }
412+ for (String f : givenArguments ) {
413+ if (f .startsWith ("--" + key )) {
414+ return ;
415+ }
411416 }
417+ contextBuilder .option (key , value );
412418 }
413419
414420 private static void printFileNotFoundException (NoSuchFileException e ) {
You can’t perform that action at this time.
0 commit comments