| Algorithm 2. Part of the “run” function within the abstract ToolExecutor class. |
| self.logger.debug(f’Running command: <{command}>’) |
| if self.verbose: |
| self.logger.debug(f’\tkeywords: <{proc_flags}>’) |
| try: |
| output = subprocess.run(command, **proc_flags) |
| except subprocess.TimeoutExpired as e: |
| self.logger.debug(f’Process timout’) |
| return True |
| else: |
| if self.verbose: |
| self.logger.debug(f’Captured stdout: <{output.stdout[:-1]}>’) |
| self.logger.debug(f’Captured stderr: <{output.stderr}>’) |
| return output |