diff --git a/libnmap/process.py b/libnmap/process.py index d53854f..387b827 100644 --- a/libnmap/process.py +++ b/libnmap/process.py @@ -327,6 +327,11 @@ def run(self): # Call the callback one last time to signal the new state if self.__nmap_event_callback: self.__nmap_event_callback(self) + + # Close I/O handlers before exiting + self.__nmap_proc.stdout.close() + self.__nmap_proc.stderr.close() + return self.rc def run_background(self):