Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2629)

Unified Diff: build/print_python_deps.py

Issue 2489393002: Use the proper sys.path in build/print_python_deps.py (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/print_python_deps.py
diff --git a/build/print_python_deps.py b/build/print_python_deps.py
index 3d0c9a8e140795010476c86158a04094834abdd5..50a1f08f4bf6e87a780ac3a173b48c3e41c7705d 100755
--- a/build/print_python_deps.py
+++ b/build/print_python_deps.py
@@ -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)
jbudorick 2016/11/10 19:41:02 Do we want anything else in sys.path at all? I'm c
agrieve 2016/11/10 19:45:35 If you clear out sys.path, then normal system impo
jbudorick 2016/11/10 19:49:12 I guess I'm concerned about the case where a modul
imp.load_source('NAME', options.module)
paths_set = _ComputePythonDependencies()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698