(cmd)
| 236 | |
| 237 | |
| 238 | def run_command_with_process(cmd): |
| 239 | is_win = sys.platform == "win32" |
| 240 | with subprocess.Popen(shlex.split(cmd, posix=is_win), shell=is_win) as proc: |
| 241 | proc.wait() |
| 242 | if proc.poll() is None: |
| 243 | logger.warning("🚨 trying to terminate subprocess in safe way") |
| 244 | try: |
| 245 | proc.communicate() |
| 246 | except Exception: # pylint: disable=broad-except |
| 247 | logger.exception("🚨 first try communicate failed") |
| 248 | proc.kill() |
| 249 | proc.communicate() |
| 250 | |
| 251 | |
| 252 | def compute_hash(path): |