| 24 | |
| 25 | |
| 26 | class Popen(subprocess.Popen): |
| 27 | |
| 28 | # We always use these options |
| 29 | def __init__(self, args, **kwargs): |
| 30 | # Add the module directory to the path to be able to find the examples |
| 31 | path = f"{os.path.dirname(__file__)}{os.pathsep}{os.environ['PATH']}" |
| 32 | super(Popen, self).\ |
| 33 | __init__(args, |
| 34 | shell=False, |
| 35 | stderr=subprocess.STDOUT, |
| 36 | stdout=subprocess.PIPE, |
| 37 | universal_newlines=True, |
| 38 | env={'PATH': path}, |
| 39 | **kwargs) |
| 40 | |
| 41 | |
| 42 | # Like subprocess.run with our defaults but returning the Popen object |
no outgoing calls