Skip to content
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

E402: Add "with" to allowed_try_keywords #833

Closed
EricCousineau-TRI opened this issue Jan 30, 2019 · 0 comments · Fixed by #834
Closed

E402: Add "with" to allowed_try_keywords #833

EricCousineau-TRI opened this issue Jan 30, 2019 · 0 comments · Fixed by #834

Comments

@EricCousineau-TRI
Copy link
Contributor

For certain imports, it would be nice to scope warning filters (e.g. in RobotLocomotion/drake#10527).

In my case, I want to do something like:

import warnings

with warnings.catch_warnings():
    warnings.filterwarnings(
        "ignore", category=ImportWarning,
        message="can't resolve package from __spec__")
    import meshcat

Without mods to 2.3.1, it throws a warning about this. If I add "with" to the allowed keywords, then it works.

Would it be possible to add this keyword?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant