From 46886f0c3cd8babe63573388a7b91191665c1662 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Wed, 24 Jul 2019 14:57:09 -0400 Subject: [PATCH] added auto port find --- tests/debug.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/debug.py b/tests/debug.py index cb6306ed48..473df9bfb2 100644 --- a/tests/debug.py +++ b/tests/debug.py @@ -128,12 +128,14 @@ def mainasdf(): clear_save_dir() -def get_pids(port): + + +if __name__ == '__main__': import subprocess import re print('getting pid') - command = "sudo lsof -i :%s | awk '{print $2}'" % port + command = "sudo lsof -i :%s | awk '{print $2}'" % 12910 pids = subprocess.check_output(command, shell=True) pids = pids.strip() print(pids) @@ -143,8 +145,4 @@ def get_pids(port): try: yield int(pid) except: - pass - - -if __name__ == '__main__': - get_pids(12910) \ No newline at end of file + pass \ No newline at end of file