diff options
author | Brett Cannon <brett@python.org> | 2014-08-29 11:16:29 -0400 |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2014-08-29 11:16:29 -0400 |
commit | 131810f8df6431ffef5d0cf345d67aeec7c3c605 (patch) | |
tree | d4c1219e564ccffc8feeb3b42785038a47cc14e6 /checkers/utils.py | |
parent | 2995e293950edc39b0466d1274affc1136c066c8 (diff) | |
download | pylint-131810f8df6431ffef5d0cf345d67aeec7c3c605.tar.gz |
Modernize to the point of working for Python 2.7 still
Diffstat (limited to 'checkers/utils.py')
-rw-r--r-- | checkers/utils.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/checkers/utils.py b/checkers/utils.py index af1440d..55bcdd4 100644 --- a/checkers/utils.py +++ b/checkers/utils.py @@ -87,11 +87,11 @@ def safe_infer(node): """ try: inferit = node.infer() - value = inferit.next() + value = next(inferit) except astroid.InferenceError: return try: - inferit.next() + next(inferit) return # None if there is ambiguity on the inferred node except astroid.InferenceError: return # there is some kind of ambiguity @@ -471,7 +471,7 @@ def has_known_bases(klass): pass try: for base in klass.bases: - result = base.infer().next() + result = next(base.infer()) # TODO: check for A->B->A->B pattern in class structure too? if not isinstance(result, astroid.Class) or result is klass or not has_known_bases(result): klass._all_bases_known = False |