Github user kiszk commented on a diff in the pull request:
https://github.com/apache/spark/pull/19998#discussion_r157332103
--- Diff: dev/run-tests.py ---
@@ -253,9 +253,14 @@ def kill_zinc_on_port(zinc_port):
"""
Kill the Zinc process running on the given port, if one exists.
"""
- cmd = ("/usr/sbin/lsof -P |grep %s | grep LISTEN "
- "| awk '{ print $2; }' | xargs kill") % zinc_port
- subprocess.check_call(cmd, shell=True)
+ try:
+ cmd = ("lsof -P |grep %s | grep LISTEN "
+ "| awk '{ print $2; }' | xargs kill") % zinc_port
+ subprocess.check_call(cmd, shell=True)
+ except:
--- End diff --
Yes, if the command does not exist, an exception occurs. Thus, we can
execute one of the two cases.
Yea, to use `cmd` is fine.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]