Skip to content

Commit 9fb61fa

Browse files
committed
both envvar and commandline option should be honored for warnings
1 parent 1db5721 commit 9fb61fa

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,14 @@ protected void launch(Builder contextBuilder) {
395395
verboseFlag = verboseFlag || System.getenv("PYTHONVERBOSE") != null;
396396
unbufferedIO = unbufferedIO || System.getenv("PYTHONUNBUFFERED") != null;
397397
dontWriteBytecode = dontWriteBytecode || System.getenv("PYTHONDONTWRITEBYTECODE") != null;
398-
if (warnOptions == null) {
399-
warnOptions = System.getenv("PYTHONWARNINGS");
398+
399+
String envWarnOptions = System.getenv("PYTHONWARNINGS");
400+
if (envWarnOptions != null && !envWarnOptions.isEmpty()) {
401+
if (warnOptions == null) {
402+
warnOptions = envWarnOptions;
403+
} else {
404+
warnOptions = envWarnOptions + "," + warnOptions;
405+
}
400406
}
401407
String cachePrefix = System.getenv("PYTHONPYCACHEPREFIX");
402408
if (cachePrefix != null) {

0 commit comments

Comments
 (0)