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

Unified Diff: tools/telemetry/telemetry/core/util.py

Issue 321773002: [PowerProfiler] Make sure correct version of pySerial is imported with monsoon profiler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 months 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
Index: tools/telemetry/telemetry/core/util.py
diff --git a/tools/telemetry/telemetry/core/util.py b/tools/telemetry/telemetry/core/util.py
index efeab5aa7f8eaf6af6e20741002397a34ea5411d..f35f016d2d0881fba29b9d98a9d2b103b3eb2288 100644
--- a/tools/telemetry/telemetry/core/util.py
+++ b/tools/telemetry/telemetry/core/util.py
@@ -35,6 +35,12 @@ def GetUnittestDataDir():
def GetChromiumSrcDir():
return os.path.normpath(os.path.join(GetTelemetryDir(), os.pardir, os.pardir))
+def InsertDirInPythonPath(index, *path_parts):
tonyg 2014/06/09 16:13:35 Dave should review this part. I wonder whether we
dtu 2014/06/09 20:14:05 +1 to this suggestion, we don't need an extra func
+ path = os.path.abspath(os.path.join(*path_parts))
+ if os.path.isdir(path):
+ if path in sys.path:
+ sys.path.remove(path)
+ sys.path.insert(index, path)
def AddDirToPythonPath(*path_parts):
path = os.path.abspath(os.path.join(*path_parts))

Powered by Google App Engine
This is Rietveld 408576698