-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
taichi.lang.util.warning
doesn't respect stdlib warnings
filters
#4543
Comments
Thanks for pointing this out! Option 1 looks good to me. |
I agree to use the standard |
Option 1 sounds great to me! @RuRo would you mind sending a PR to update this function? Thanks a lot! |
Hi, sorry for the delayed reply. Unfortunately, I am kind of busy lately, so I won't be able to contribute anything in the forceable future. I'll keep submitting issues as I run into them while using taichi and I might revisit them once I get some free time. No promises tho, so if anyone wants to contribute it, that would be great. |
I'd like to take a shot on this @ailzhang |
@pigletfly Awesome it's yours! Please don't hesitate to ping us here if you have any questions! |
…l.warning (taichi-dev#7301) Issue: taichi-dev#4543 ### Brief Summary Changed print statement in `taichi.lang.util.warning` to `warnings.warn` to respect stdlib warnings filters --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
The
taichi.lang.util.warning
function just prints the warning without consulting the current state of pythons standard librarywarnings
module.For example:
You should either
warnings.warn
instead ofprint
(preferable, imho)Additionally,
ti.lang.util.warning
prints the errors tostdout
instead of thestderr
, which is also wrong.The text was updated successfully, but these errors were encountered: