equal
deleted
inserted
replaced
624 def find_cycles(imports): |
624 def find_cycles(imports): |
625 """Find cycles in an already-loaded import graph. |
625 """Find cycles in an already-loaded import graph. |
626 |
626 |
627 All module names recorded in `imports` should be absolute one. |
627 All module names recorded in `imports` should be absolute one. |
628 |
628 |
629 >>> from __future__ import print_function |
|
630 >>> imports = {'top.foo': ['top.bar', 'os.path', 'top.qux'], |
629 >>> imports = {'top.foo': ['top.bar', 'os.path', 'top.qux'], |
631 ... 'top.bar': ['top.baz', 'sys'], |
630 ... 'top.bar': ['top.baz', 'sys'], |
632 ... 'top.baz': ['top.foo'], |
631 ... 'top.baz': ['top.foo'], |
633 ... 'top.qux': ['top.foo']} |
632 ... 'top.qux': ['top.foo']} |
634 >>> print('\\n'.join(sorted(find_cycles(imports)))) |
633 >>> print('\\n'.join(sorted(find_cycles(imports)))) |