On 5/2/24 3:50 PM, Bruno Haible wrote: >> Would the following be correct? >> >> command = ['sh', '-c', f'patch {shlex.quote(test_driver)} < >> {shlex.quote(diff)}'] >> try: >> result = sp.call(command, stdout=sp.DEVNULL, stderr=sp.DEVNULL) >> except OSError as exc: >> ... > > Yes, this looks correct. But it needs to be conditionalized, so that we > continue > to keep the simpler (and often also faster) code on Unix.
Yeah, off the top of my head it doesn't seem like it would be too difficult to do something like: def execute_script(command: str) -> None: # Check platform, avoid shell=True if possible. but I haven't put too much thought into it yet. Thanks for the help! Collin