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

Unified Diff: remoting/host/linux/linux_me2me_host.py

Issue 883063002: Fix linux_me2me_host.py to handle relative path to self. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« 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: remoting/host/linux/linux_me2me_host.py
diff --git a/remoting/host/linux/linux_me2me_host.py b/remoting/host/linux/linux_me2me_host.py
index cd8e71ed602937b620d327ad9fff74f430df8adc..358e0d462012eb447ddca7846cfba7f0c4e81213 100755
--- a/remoting/host/linux/linux_me2me_host.py
+++ b/remoting/host/linux/linux_me2me_host.py
@@ -49,7 +49,8 @@ DEFAULT_SIZES = "1600x1200,3840x2560"
# resolution is supported in this case.
DEFAULT_SIZE_NO_RANDR = "1600x1200"
-SCRIPT_PATH = sys.path[0]
+SCRIPT_PATH = os.path.abspath(sys.argv[0])
+SCRIPT_DIR = os.path.dirname(SCRIPT_PATH)
IS_INSTALLED = (os.path.basename(sys.argv[0]) != 'linux_me2me_host.py')
@@ -445,7 +446,7 @@ class Desktop:
subprocess.call(args, env=self.child_env, stdout=devnull, stderr=devnull)
# Monitor for any automatic resolution changes from the desktop environment.
- args = [sys.argv[0], "--watch-resolution", str(initial_size[0]),
+ args = [SCRIPT_PATH, "--watch-resolution", str(initial_size[0]),
str(initial_size[1])]
# It is not necessary to wait() on the process here, as this script's main
@@ -608,9 +609,9 @@ def locate_executable(exe_name):
if IS_INSTALLED:
# If the script is running from its installed location, search the host
# binary only in the same directory.
- paths_to_try = [ SCRIPT_PATH ]
+ paths_to_try = [ SCRIPT_DIR ]
else:
- paths_to_try = map(lambda p: os.path.join(SCRIPT_PATH, p),
+ paths_to_try = map(lambda p: os.path.join(SCRIPT_DIR, p),
[".", "../../../out/Debug", "../../../out/Release" ])
for path in paths_to_try:
exe_path = os.path.join(path, exe_name)
@@ -885,7 +886,7 @@ class RelaunchInhibitor:
def relaunch_self():
cleanup()
- os.execvp(sys.argv[0], sys.argv)
+ os.execvp(SCRIPT_PATH, sys.argv)
def waitpid_with_timeout(pid, deadline):
« 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