summaryrefslogtreecommitdiff
path: root/pylint/constants.py
diff options
context:
space:
mode:
authorSergei Lebedev <185856+superbobry@users.noreply.github.com>2021-06-27 19:11:54 +0100
committerGitHub <noreply@github.com>2021-06-27 20:11:54 +0200
commit3d6389b97e8f9416304185a1babfe49e8a0dc348 (patch)
tree84cd6ce8b03f4317d290fc6ac7bd005ea4e0a6aa /pylint/constants.py
parent1e55ae64624d28c5fe8b63ad7979880ee2e6ef3f (diff)
downloadpylint-git-3d6389b97e8f9416304185a1babfe49e8a0dc348.tar.gz
VariableChecker now accounts for attribute lookups in type comments (#4604)
* VariableChecker now accounts for attribute lookups in type comments Prior to this commit VariableChecker did not recurse into attribute lookups in type comments. This lead to false positive unused-import messages in e.g. import collections d = ... # type: collections.OrderedDict Fixes #4603
Diffstat (limited to 'pylint/constants.py')
-rw-r--r--pylint/constants.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/pylint/constants.py b/pylint/constants.py
index b95d701c0..786cde7d0 100644
--- a/pylint/constants.py
+++ b/pylint/constants.py
@@ -1,6 +1,7 @@
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/master/LICENSE
+import platform
import sys
import astroid
@@ -11,6 +12,7 @@ PY38_PLUS = sys.version_info[:2] >= (3, 8)
PY39_PLUS = sys.version_info[:2] >= (3, 9)
PY310_PLUS = sys.version_info[:2] >= (3, 10)
+IS_PYPY = platform.python_implementation() == "PyPy"
PY_EXTS = (".py", ".pyc", ".pyo", ".pyw", ".so", ".dll")