Commit 1492c3d2 authored by lambroslambrou's avatar lambroslambrou Committed by Commit bot

Chromoting Linux host: Replace subprocess.Popen() with subprocess.call()

subprocess.call() is documented as accepting the same arguments as
subprocess.Popen(). This lets us simplify some usages.

NOTRY=true

Review URL: https://codereview.chromium.org/698103003

Cr-Commit-Position: refs/heads/master@{#302630}
parent ffd7b290
...@@ -395,8 +395,7 @@ class Desktop: ...@@ -395,8 +395,7 @@ class Desktop:
# Wait for X to be active. # Wait for X to be active.
for _test in range(20): for _test in range(20):
proc = subprocess.Popen("xdpyinfo", env=self.child_env, stdout=devnull) retcode = subprocess.call("xdpyinfo", env=self.child_env, stdout=devnull)
_pid, retcode = os.waitpid(proc.pid, 0)
if retcode == 0: if retcode == 0:
break break
time.sleep(0.5) time.sleep(0.5)
...@@ -411,9 +410,8 @@ class Desktop: ...@@ -411,9 +410,8 @@ class Desktop:
# Reconfigure the X server to use "evdev" keymap rules. The X server must # Reconfigure the X server to use "evdev" keymap rules. The X server must
# be started with -noreset otherwise it'll reset as soon as the command # be started with -noreset otherwise it'll reset as soon as the command
# completes, since there are no other X clients running yet. # completes, since there are no other X clients running yet.
proc = subprocess.Popen("setxkbmap -rules evdev", env=self.child_env, retcode = subprocess.call("setxkbmap -rules evdev", env=self.child_env,
shell=True) shell=True)
_pid, retcode = os.waitpid(proc.pid, 0)
if retcode != 0: if retcode != 0:
logging.error("Failed to set XKB to 'evdev'") logging.error("Failed to set XKB to 'evdev'")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment