hc99's picture
Add files using upload-large-folder tool
ff88fc5 verified
raw
history blame
378 Bytes
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from subprocess import PIPE, Popen
from typing import Any
def run_with_error(cmd: Any) -> str:
with Popen(cmd, stdout=PIPE, stderr=PIPE) as p:
_stdout, stderr = p.communicate()
err = stderr.decode("utf-8").rstrip().replace("\r\n", "\n")
assert p.returncode == 1
return err