summaryrefslogtreecommitdiff
path: root/__init__.py
diff options
context:
space:
mode:
authorMike Frysinger <vapier@chromium.org>2012-11-16 18:22:39 -0500
committerGerrit <chrome-bot@google.com>2012-12-07 17:13:24 -0800
commitb94efe9823f9109a8345d0d5e0743b311ec2b3a6 (patch)
treebdfd85985cf8a50ca81d6b5e245f3f83418ab20e /__init__.py
parent73bf49bbec4a9ef9ba0b24bc6896a757ed5700d0 (diff)
downloadchromite-b94efe9823f9109a8345d0d5e0743b311ec2b3a6.tar.gz
chromite: add third_party to search path
When we have third_party packages that depend on other third_party packages, we can't update them to use the "chromite.third_party.*" namespace. So add the top of the third_party dir to the search path so things "just work". BUG=chromium-os:36453 TEST=buildbot/run_tests passed Change-Id: I1f22752d3223fd964faed92c09602772ba30e628 Reviewed-on: https://gerrit.chromium.org/gerrit/38243 Reviewed-by: Brian Harring <ferringb@chromium.org> Reviewed-by: David James <davidjames@chromium.org> Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>
Diffstat (limited to '__init__.py')
-rw-r--r--__init__.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/__init__.py b/__init__.py
index e69de29bb..dd845c3bb 100644
--- a/__init__.py
+++ b/__init__.py
@@ -0,0 +1,14 @@
+# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import os
+import sys
+
+# Add the third_party/ dir to our search path so that we can find the
+# modules in there automatically. This isn't normal, so don't replicate
+# this pattern elsewhere.
+third_party = os.path.normpath(os.path.join(os.path.dirname(os.path.realpath(
+ __file__)), 'third_party'))
+sys.path.insert(0, third_party)
+del third_party