From b971ce468355fb9f96dfbd8ad4fc76a6a39c1fea Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Mon, 3 Dec 2012 17:13:41 -0500 Subject: [PATCH] mirroring: Fix import by putting 'api' path first (imported from commit b35d962d6456f01b97deeeaa328faa03b65494f8) --- bots/check-mirroring | 6 ++++-- bots/zephyr_mirror_backend.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bots/check-mirroring b/bots/check-mirroring index 67f95dd..b2e861c 100755 --- a/bots/check-mirroring +++ b/bots/check-mirroring @@ -26,7 +26,10 @@ parser.add_option('--root-path', action='store') (options, args) = parser.parse_args() -sys.path[:0] = [os.path.join(options.root_path, "python-zephyr"), +# The 'api' directory needs to go first, so that 'import humbug' won't pick up +# some other directory named 'humbug'. +sys.path[:0] = [os.path.join(options.root_path, "api/"), + os.path.join(options.root_path, "python-zephyr"), os.path.join(options.root_path, "python-zephyr/build/lib.linux-x86_64-2.6/"), options.root_path] @@ -34,7 +37,6 @@ mit_user = 'tabbott/extra@ATHENA.MIT.EDU' humbug_user = 'tabbott/extra@mit.edu' sys.path.append(".") -sys.path.append(path.join(path.dirname(__file__), '..')) import humbug humbug_client = humbug.Client( email=humbug_user, diff --git a/bots/zephyr_mirror_backend.py b/bots/zephyr_mirror_backend.py index 43dc13e..058c8dd 100755 --- a/bots/zephyr_mirror_backend.py +++ b/bots/zephyr_mirror_backend.py @@ -774,8 +774,10 @@ if __name__ == "__main__": (options, args) = parse_args() - sys.path[:0] = [options.root_path, - os.path.join(options.root_path, 'api'), + # The 'api' directory needs to go first, so that 'import humbug' won't pick + # up some other directory named 'humbug'. + sys.path[:0] = [os.path.join(options.root_path, 'api'), + options.root_path, os.path.join(options.root_path, "python-zephyr"), os.path.join(options.root_path, "python-zephyr/build/lib.linux-x86_64-2.6/")]