Skip to content

Commit

Permalink
fix progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
jm33-m0 committed Dec 24, 2019
1 parent 723038f commit 5dae038
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/cli/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import subprocess
import sys
import time
import traceback
from multiprocessing import Process

import psutil
Expand Down Expand Up @@ -307,10 +308,14 @@ def scan(self):

finally:
# check if any procs are done, remove them from pool, update progress bar
for proc in pool:
if not psutil.pid_exists(proc.pid):
proc.remove(proc)
pbar.update(1)
try:
for proc in pool:
if proc.poll() is not None:
pool.remove(proc)
pbar.update(1)
except BaseException:
logfile.write("[-] Exception: " +
traceback.format_exc() + "\n")

# make sure all processes are done

Expand Down

0 comments on commit 5dae038

Please sign in to comment.