MCPcopy Create free account
hub / github.com/ElementsProject/lightning / subprocess_run

Function subprocess_run

tests/test_mkfunding.py:28–59  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

26
27
28def subprocess_run(args):
29 try:
30 response = subprocess.run(
31 args,
32 timeout=TIMEOUT,
33 capture_output=True,
34 encoding='utf-8')
35 print("*** returncode ***")
36 print(response.returncode)
37 print("*** stderr ***")
38 print(response.stderr)
39 print("*** stdout ***")
40 print(response.stdout.strip())
41 return response
42 except Exception:
43 # Get current system exception
44 ex_type, ex_value, ex_traceback = sys.exc_info()
45
46 # Extract unformatter stack traces as tuples
47 trace_back = traceback.extract_tb(ex_traceback)
48
49 # Format stacktrace
50 stack_trace = list()
51
52 for trace in trace_back:
53 stack_trace.append(
54 "File : %s , Line : %d, Func.Name : %s, Message : %s" %
55 (trace[0], trace[1], trace[2], trace[3]))
56
57 print("Exception type : %s" % ex_type.__name__)
58 print("Exception message : %s" % ex_value)
59 print("Stack trace : %s" % stack_trace)
60
61
62def test_mkfunding_bad_usage():

Calls 1

runMethod · 0.45

Tested by

no test coverage detected