@@ -104,6 +104,8 @@ public static void main(String[] args) {
104
104
105
105
boolean useASTInterpreter = false ;
106
106
107
+ private String toolInstrumentWarning = null ;
108
+
107
109
protected static void setStartupTime () {
108
110
if (GraalPythonMain .startupNanoTime == -1 ) {
109
111
GraalPythonMain .startupNanoTime = System .nanoTime ();
@@ -124,7 +126,6 @@ protected List<String> preprocessArguments(List<String> givenArgs, Map<String, S
124
126
List <String > subprocessArgs = new ArrayList <>();
125
127
programArgs = new ArrayList <>();
126
128
boolean posixBackendSpecified = false ;
127
- boolean toolInstrumentWarning = true ;
128
129
for (Iterator <String > argumentIterator = arguments .iterator (); argumentIterator .hasNext ();) {
129
130
String arg = argumentIterator .next ();
130
131
if (arg .startsWith ("-" )) {
@@ -203,10 +204,7 @@ protected List<String> preprocessArguments(List<String> givenArgs, Map<String, S
203
204
if (argStartsWith (arg , "--agentscript" , "--coverage" , "--cpusampler" , "--cputracer" , "--dap" ,
204
205
"--heap." , "--heapmonitor" , "--insight" , "--inspect" , "--lsp" , "--memtracer" , "--sandbox." )) {
205
206
useASTInterpreter = true ;
206
- if (toolInstrumentWarning ) {
207
- toolInstrumentWarning = false ;
208
- System .out .println ("WARNING: Switching to AST interpreter due to instruments option " + arg );
209
- }
207
+ toolInstrumentWarning = "WARNING: Switching to AST interpreter due to instruments option " + arg ;
210
208
} else if (arg .startsWith ("--llvm." ) ||
211
209
matchesPythonOption (arg , "CoreHome" ) ||
212
210
matchesPythonOption (arg , "StdLibHome" ) ||
@@ -620,6 +618,10 @@ protected void launch(Builder contextBuilder) {
620
618
contextBuilder .option ("python.PyCachePrefix" , "/dev/null" );
621
619
contextBuilder .option ("python.EnableBytecodeInterpreter" , "false" );
622
620
contextBuilder .option ("python.DisableFrozenModules" , "true" );
621
+ if (toolInstrumentWarning != null ) {
622
+ System .out .println (toolInstrumentWarning );
623
+ toolInstrumentWarning = null ;
624
+ }
623
625
} else {
624
626
contextBuilder .option ("python.DontWriteBytecodeFlag" , Boolean .toString (dontWriteBytecode ));
625
627
if (cachePrefix != null ) {
0 commit comments