summaryrefslogtreecommitdiff
path: root/checkers
diff options
context:
space:
mode:
authorClaudiu Popa <cpopa@cloudbasesolutions.com>2014-11-15 13:01:02 +0200
committerClaudiu Popa <cpopa@cloudbasesolutions.com>2014-11-15 13:01:02 +0200
commitaab70931865129cc8c2116802c8e9178d8fd8459 (patch)
treeecf02cb0036b0804260bfa7d1ba0661d5193aabc /checkers
parent976bd966ba8e4330fedd1b01141e62e4125fabb8 (diff)
downloadpylint-git-aab70931865129cc8c2116802c8e9178d8fd8459.tar.gz
Pass the vertices explicitly to get_cycles.
This patch circumvents the bug of get_cycles from logilab.common 0.63, where get_cycles receives a defaultdict instead, which will trigger a RuntimeError "dictionary changed size during iteration".
Diffstat (limited to 'checkers')
-rw-r--r--checkers/imports.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/checkers/imports.py b/checkers/imports.py
index 22c0b3ca8..1b59b2909 100644
--- a/checkers/imports.py
+++ b/checkers/imports.py
@@ -237,7 +237,8 @@ given file (report RP0402 must not be disabled)'}
"""called before visiting project (i.e set of modules)"""
# don't try to compute cycles if the associated message is disabled
if self.linter.is_message_enabled('cyclic-import'):
- for cycle in get_cycles(self.import_graph):
+ vertices = list(self.import_graph)
+ for cycle in get_cycles(self.import_graph, vertices=vertices):
self.add_message('cyclic-import', args=' -> '.join(cycle))
def visit_import(self, node):