Skip to content

Commit 6c29a11

Browse files
committed
address review comment
1 parent 964e5ff commit 6c29a11

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

dev/run-tests.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,8 @@ def kill_zinc_on_port(zinc_port):
254254
Kill the Zinc process running on the given port, if one exists.
255255
"""
256256
cmd = "%s -P |grep %s | grep LISTEN | awk '{ print $2; }' | xargs kill"
257-
try:
258-
subprocess.check_call(cmd % ("lsof", zinc_port), shell=True)
259-
except:
260-
subprocess.check_call(cmd % ("/usr/sbin/lsof", zinc_port), shell=True)
257+
lsof_exe = which("lsof")
258+
subprocess.check_call(cmd % (lsof_exe if lsof_exe else "/usr/sbin/lsof", zinc_port), shell=True)
261259

262260

263261
def exec_maven(mvn_args=()):

0 commit comments

Comments
 (0)