-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Ignore import errors if in guarded import block #4702
Merged
Pierre-Sassoulas
merged 3 commits into
pylint-dev:main
from
cdce8p:guarded-import-block
Jul 19, 2021
Merged
Ignore import errors if in guarded import block #4702
Pierre-Sassoulas
merged 3 commits into
pylint-dev:main
from
cdce8p:guarded-import-block
Jul 19, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cdce8p
added
the
False Positive 🦟
A message is emitted but nothing is wrong with the code
label
Jul 11, 2021
@Pierre-Sassoulas What do you think? I'm open to other ideas if you have any |
Pierre-Sassoulas
approved these changes
Jul 12, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job on adding the typing, little by little we'll end up having proper typing :D
cdce8p
force-pushed
the
guarded-import-block
branch
from
July 13, 2021 13:03
5564c2d
to
afb146a
Compare
cdce8p
added
the
Needs astroid update
Needs an astroid update (probably a release too) before being mergable
label
Jul 13, 2021
cdce8p
force-pushed
the
guarded-import-block
branch
2 times, most recently
from
July 14, 2021 16:14
9016282
to
77ba57b
Compare
Pierre-Sassoulas
force-pushed
the
guarded-import-block
branch
from
July 19, 2021 19:50
77ba57b
to
6653bc8
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
False Positive 🦟
A message is emitted but nothing is wrong with the code
Needs astroid update
Needs an astroid update (probably a release too) before being mergable
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Ignore the following error messages if import is in guarded if block (
sys.version_info
ortyping.TYPE_CHECKING
):import-error
no-name-in-module
ungrouped-imports
Although just ignoring them isn't ideal, that seems to be the best we can do here. Besides, a fix seems to be highly requested.
Type of Changes
Related Issue
Closes #3285
Closes #3382