According to this Python 2.7 spec, calling Popen.wait()
or Popen.poll()
sets the Popen.returncode
attribute. I guess you can try:
p = subprocess.Popen("svn checkout file:///tmp/repos/test mine")
p.wait() # this deadlocks the thread until process completion, so use with care
# There was an error
if p.returncode != 0:
# ...
According to the spec:
The child return code, set by poll() and wait() (and indirectly by communicate()). A None value indicates that the process hasn’t terminated yet. A negative value -N indicates that the child was terminated by signal N (Unix only).