Skip to content

Commit

Permalink
Use the proper sys.path in build/print_python_deps.py
Browse files Browse the repository at this point in the history
We need to ensure the main module's directory is the first entry in
sys.path.

BUG=662258

Review-Url: https://codereview.chromium.org/2489393002
Cr-Commit-Position: refs/heads/master@{#431327}
  • Loading branch information
agrieve authored and Commit bot committed Nov 10, 2016
1 parent e92dd4c commit 69a180f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion build/print_python_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ def main():
help='Recursively include all non-test python files '
'within this directory. May be specified multiple times.')
options = parser.parse_args()
sys.path.append(os.path.dirname(options.module))
# Replace the path entry for print_python_deps.py with the one for the given
# module.
sys.path[0] = os.path.dirname(options.module)
imp.load_source('NAME', options.module)

paths_set = _ComputePythonDependencies()
Expand Down

0 comments on commit 69a180f

Please sign in to comment.