This is a weak check, it could fail and not print anything to stderr, I would instead do this:

```python
p = subprocess.Popen(...)
out, err = p.communicate()
if p.returncode != 0:
   ...
```