Skip to content

Commit

Permalink
add ProcessLookupError handle
Browse files Browse the repository at this point in the history
  • Loading branch information
VanDavv committed Jan 25, 2022
1 parent cb38edb commit f15cf1b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions depthai_helpers/app_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,12 @@ def runApp(self, shouldRun = lambda: True):
except KeyboardInterrupt:
break
if pro.poll() is not None:
if os.name == 'nt':
subprocess.call(['taskkill', '/F', '/T', '/PID', str(pro.pid)])
else:
os.kill(pro.pid, signal.SIGTERM)
try:
if os.name == 'nt':
subprocess.call(['taskkill', '/F', '/T', '/PID', str(pro.pid)])
else:
os.kill(pro.pid, signal.SIGTERM)
except ProcessLookupError:
pass


0 comments on commit f15cf1b

Please sign in to comment.