diff --git a/contrib/import-checker.py b/contrib/import-checker.py --- a/contrib/import-checker.py +++ b/contrib/import-checker.py @@ -564,7 +564,7 @@ def main(argv): print 'Import cycle:', c firstmods.add(first) any_errors = True - return not any_errors + return any_errors != 0 if __name__ == '__main__': sys.exit(int(main(sys.argv))) diff --git a/tests/test-module-imports.t b/tests/test-module-imports.t --- a/tests/test-module-imports.t +++ b/tests/test-module-imports.t @@ -101,6 +101,7 @@ Run additional tests for the import chec testpackage/subpackage/levelpriority.py higher-level import should come first: testpackage testpackage/symbolimport.py direct symbol import from testpackage.unsorted testpackage/unsorted.py imports not lexically sorted: os < sys + [1] $ cd "$TESTDIR"/.. @@ -129,3 +130,4 @@ these may expose other cycles. Import cycle: mercurial.cmdutil -> mercurial.context -> mercurial.subrepo -> mercurial.cmdutil Import cycle: hgext.largefiles.basestore -> hgext.largefiles.localstore -> hgext.largefiles.basestore Import cycle: mercurial.commands -> mercurial.commandserver -> mercurial.dispatch -> mercurial.commands + [1]