mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
Fix flake8 warnings
This commit is contained in:
committed by
Christian Decker
parent
cf3f19524e
commit
d2109bfe0c
@@ -36,7 +36,7 @@ def bitcoind():
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
bitcoind.rpc.stop()
|
bitcoind.rpc.stop()
|
||||||
except:
|
except Exception:
|
||||||
bitcoind.proc.kill()
|
bitcoind.proc.kill()
|
||||||
bitcoind.proc.wait()
|
bitcoind.proc.wait()
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ def setupBitcoind(directory):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
bitcoind.start()
|
bitcoind.start()
|
||||||
except:
|
except Exception:
|
||||||
teardown_bitcoind()
|
teardown_bitcoind()
|
||||||
raise
|
raise
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ def teardown_bitcoind():
|
|||||||
global bitcoind
|
global bitcoind
|
||||||
try:
|
try:
|
||||||
bitcoind.rpc.stop()
|
bitcoind.rpc.stop()
|
||||||
except:
|
except Exception:
|
||||||
bitcoind.proc.kill()
|
bitcoind.proc.kill()
|
||||||
bitcoind.proc.wait()
|
bitcoind.proc.wait()
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ class NodeFactory(object):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
node.daemon.start()
|
node.daemon.start()
|
||||||
except:
|
except Exception:
|
||||||
node.daemon.stop()
|
node.daemon.stop()
|
||||||
raise
|
raise
|
||||||
|
|
||||||
@@ -173,12 +173,12 @@ class NodeFactory(object):
|
|||||||
try:
|
try:
|
||||||
# This also puts leaks in log.
|
# This also puts leaks in log.
|
||||||
leaks = self.nodes[i].rpc.dev_memleak()['leaks']
|
leaks = self.nodes[i].rpc.dev_memleak()['leaks']
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.nodes[i].stop()
|
self.nodes[i].stop()
|
||||||
except:
|
except Exception:
|
||||||
if expected_successes[i]:
|
if expected_successes[i]:
|
||||||
unexpected_fail = True
|
unexpected_fail = True
|
||||||
|
|
||||||
@@ -223,7 +223,7 @@ class BaseLightningDTests(unittest.TestCase):
|
|||||||
crashlog = os.path.join(node.daemon.lightning_dir, 'crash.log')
|
crashlog = os.path.join(node.daemon.lightning_dir, 'crash.log')
|
||||||
with open(crashlog, 'r') as f:
|
with open(crashlog, 'r') as f:
|
||||||
return f.readlines(), crashlog
|
return f.readlines(), crashlog
|
||||||
except:
|
except Exception:
|
||||||
return None, None
|
return None, None
|
||||||
|
|
||||||
def printCrashLog(self, node):
|
def printCrashLog(self, node):
|
||||||
@@ -3691,7 +3691,7 @@ class LightningDTests(BaseLightningDTests):
|
|||||||
.format(l1.daemon.lightning_dir),
|
.format(l1.daemon.lightning_dir),
|
||||||
'-J', '-o',
|
'-J', '-o',
|
||||||
'sendpay']).decode('utf-8')
|
'sendpay']).decode('utf-8')
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@unittest.skipIf(not DEVELOPER, "needs DEVELOPER=1")
|
@unittest.skipIf(not DEVELOPER, "needs DEVELOPER=1")
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ class LightningNode(object):
|
|||||||
def call_connect():
|
def call_connect():
|
||||||
try:
|
try:
|
||||||
self.rpc.connect('127.0.0.1', remote_node.daemon.port, tx['hex'], async=False)
|
self.rpc.connect('127.0.0.1', remote_node.daemon.port, tx['hex'], async=False)
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
t = threading.Thread(target=call_connect)
|
t = threading.Thread(target=call_connect)
|
||||||
t.daemon = True
|
t.daemon = True
|
||||||
@@ -384,7 +384,7 @@ class LightningNode(object):
|
|||||||
try:
|
try:
|
||||||
# May fail if the process already died
|
# May fail if the process already died
|
||||||
self.rpc.stop()
|
self.rpc.stop()
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
rc = self.daemon.wait(timeout)
|
rc = self.daemon.wait(timeout)
|
||||||
|
|||||||
Reference in New Issue
Block a user