diff -r 1a9efc312700 -r 642d245ff537 contrib/import-checker.py --- a/contrib/import-checker.py Fri Mar 27 01:03:06 2015 -0700 +++ b/contrib/import-checker.py Fri Mar 27 18:50:39 2015 -0500 @@ -191,7 +191,7 @@ """ lowest = min(cycle) idx = cycle.index(lowest) - return cycle[idx:] + cycle[1:idx] + [lowest] + return cycle[idx:-1] + cycle[:idx] + [lowest] def find_cycles(imports): """Find cycles in an already-loaded import graph. @@ -201,8 +201,8 @@ ... 'top.baz': ['foo'], ... 'top.qux': ['foo']} >>> print '\\n'.join(sorted(find_cycles(imports))) - top.bar -> top.baz -> top.foo -> top.bar -> top.bar - top.foo -> top.qux -> top.foo -> top.foo + top.bar -> top.baz -> top.foo -> top.bar + top.foo -> top.qux -> top.foo """ cycles = {} for mod in sorted(imports.iterkeys()):