echidna
echidna copied to clipboard
chore: fix subprocess silence logic in compiler selection
noticed a small issue in how we were setting silent for the compiler subprocess.
previously it used a combination of and/or which can lead to unexpected results.
changed it to a clear ternary expression:
silent = subprocess.DEVNULL if os.getenv("SOLC_SELECT_SILENT", "1") == "1" else None
now the behavior is straightforward and consistent.
hi! out of curiosity, what prompted this change? do you use this script somewhere? and what issues did you see? (I'm not sure how the and/or pseudo-ternary could fail here, but I agree the if/else is clearer)
I'm mainly asking as we only copy this script to the distroless docker target, and that is not a docker target we ever built on CI or people use. I've thought about removing it altogether.