MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / silent_call

Function silent_call

python-package/setup.py:74–86  ·  view source on GitHub ↗
(cmd, raise_error=False, error_msg='')

Source from the content-addressed store, hash-verified

72
73
74def silent_call(cmd, raise_error=False, error_msg=''):
75 try:
76 output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
77 with open(LOG_PATH, "ab") as log:
78 log.write(output)
79 return 0
80 except Exception as err:
81 if isinstance(err, subprocess.CalledProcessError):
82 with open(LOG_PATH, "ab") as log:
83 log.write(err.output)
84 if raise_error:
85 raise Exception("\n".join((error_msg, LOG_NOTICE)))
86 return 1
87
88
89def compile_cpp(use_mingw=False, use_gpu=False, use_mpi=False,

Callers 1

compile_cppFunction · 0.85

Calls 2

joinMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected