My minimum example is
#!/usr/bin/python3
import warnings
warnings.warn('Run Forest run!', stacklevel=2)
warnings.warn('Run Forest run!')
and it will output
sys:1: UserWarning: Run Forest run!
./file.py:6: UserWarning: Run Forest run!
warnings.warn('Run Forest run!')
The first line gives me to little info. The second line is perfect, giving me source file and line number ... but I'd like to get rid of the redundant third line. Is that possible?