-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Do not emit import-error with Py2 / Py3 import blocks #769
Comments
just for rthe record, it complains in both python2 and python3 paths:
|
The import block is a bad way to do this: use |
In some cases, having an extra dependency isn't ideal, which is the exact case here. Using six.moves.urllib doesn't solve the fact that we're wrongly emitting an error in this case. |
|
(you're probably right though.) |
6 months later, but should be fixed now. |
…cks by default. Until now, we warned with these errors when a fallback import block (a TryExcept block that contained imports for Python 2 and 3) was found, but this gets cumbersome when trying to write compatible code. As such, we don't check these blocks by default, but the analysis can be enforced by using the new ``--analyse-fallback-block`` flag. Close #769.
Given the following code, pylint emits an import-error when this gets analyzed with Python 3 for the ImportError block. We should be able to detect this and not warn about those imports.
The text was updated successfully, but these errors were encountered: