diff --git a/libnmap/process.py b/libnmap/process.py index fecda19..51a362d 100644 --- a/libnmap/process.py +++ b/libnmap/process.py @@ -331,6 +331,9 @@ def ioreader_routine(proc_stdout, io_queue, data_pushed, producing): self.__nmap_tasks[self.current_task.name].progress = 100 else: self.__state = self.FAILED + # Call the callback one last time to signal the new state + if self.__nmap_event_callback: + self.__nmap_event_callback(self) return self.rc def run_background(self): @@ -355,8 +358,8 @@ def has_terminated(self): :return: True if nmap process is not running anymore. """ - return (self.state == self.DONE or self.state == self.FAILED - or self.state == self.CANCELLED) + return (self.state == self.DONE or self.state == self.FAILED or + self.state == self.CANCELLED) def has_failed(self): """