Starting mitmproxy as subprocess

Hi, I have a large python program that needs to start mitmproxy without halting execution of the subsequent code, so I’ve been trying to make this work with the subprocess package:

process = Popen(['mitmdump', '--mode=socks5', '-s /path/to/script.py'], stdout=PIPE, stderr=PIPE)
out, error = process.communicate(timeout=5)

My problem with this approach is that the errors (and info) from my custom addon does not seem to get piped to the main program. Only errors from mitmdump itself are piped, like “OSError(98, ‘Address already in use’)” etc…I would like to know if the proxy started correctly.
Is there a better way of doing this?