code: def check_output(args):
      
      proc = Popen(args, stdout=PIPE)
      out = proc.communicate()[0]
      if proc.returncode:
          raise CalledProcessError(proc.returncode, args, output=out)
      return out
docs: Pipe-safe (and 2.6 compatible) version of subprocess.check_output