mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
pytest: Use the file object and don't use print without line-endings
This commit is contained in:
parent
ae99e493b8
commit
90f74907f9
@ -164,8 +164,7 @@ def printCrashLog(node):
|
||||
errors, fname = getCrashLog(node)
|
||||
if errors:
|
||||
print("-" * 10, "{} (last 50 lines)".format(fname), "-" * 10)
|
||||
for l in errors[-50:]:
|
||||
print(l, end='')
|
||||
print("".join(errors[-50:]))
|
||||
print("-" * 80)
|
||||
return 1 if errors else 0
|
||||
|
||||
|
@ -679,10 +679,9 @@ class NodeFactory(object):
|
||||
if fake_bitcoin_cli:
|
||||
cli = os.path.join(lightning_dir, "fake-bitcoin-cli")
|
||||
with open(cli, "w") as text_file:
|
||||
print("""#! /bin/sh
|
||||
! [ -f bitcoin-cli-fail ] || exit `cat bitcoin-cli-fail`
|
||||
exec bitcoin-cli "$@"
|
||||
""", file=text_file)
|
||||
text_file.write('#! /bin/sh\n'
|
||||
'! [ -f bitcoin-cli-fail ] || exit `cat bitcoin-cli-fail`\n'
|
||||
'exec bitcoin-cli "$@"\n')
|
||||
os.chmod(cli, os.stat(cli).st_mode | stat.S_IEXEC)
|
||||
daemon.opts['bitcoin-cli'] = cli
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user