Mike Frysinger | 8b0fc37 | 2022-09-08 07:24:24 | [diff] [blame] | 1 | # Copyright 2016 The ChromiumOS Authors |
xixuan | cf58dd3 | 2016-08-24 20:57:06 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | """Set up syspath to import chromite.""" |
| 6 | |
| 7 | from __future__ import print_function |
| 8 | |
| 9 | import os |
| 10 | import sys |
| 11 | |
| 12 | # Make sure that chromite is available to import. |
| 13 | _path = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, |
| 14 | os.pardir) |
| 15 | if _path not in sys.path: |
| 16 | sys.path.insert(0, os.path.abspath(_path)) |
| 17 | |
xixuan | ebdb0a8 | 2017-04-28 18:25:02 | [diff] [blame] | 18 | # TODO(xixuan): crbug.com/717173 |
| 19 | # delete this once there's no third-party packages in chromite. |
| 20 | try: |
| 21 | import chromite # pylint: disable=unused-import |
| 22 | except ImportError as e: |
| 23 | chromite = None |
| 24 | |
xixuan | cf58dd3 | 2016-08-24 20:57:06 | [diff] [blame] | 25 | del _path |