ruff exceptions: ConnectionError
This commit is contained in:
parent
d2bd996abe
commit
c2ffb537ca
4 changed files with 4 additions and 4 deletions
|
|
@ -231,7 +231,7 @@ class Daemon(Lockable):
|
|||
import socket
|
||||
try:
|
||||
socket.create_connection((host, port), timeout=timeout).close()
|
||||
except:
|
||||
except ConnectionError:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ class MoneroWalletDaemon(RPCDaemon):
|
|||
import socket
|
||||
try:
|
||||
socket.create_connection(('localhost', self.monerod_port), timeout=1).close()
|
||||
except:
|
||||
except ConnectionError:
|
||||
die('SocketError', f'Unable to connect to Monero daemon at localhost:{self.monerod_port}')
|
||||
|
||||
self.user = user or self.cfg.wallet_rpc_user or self.cfg.monero_wallet_rpc_user
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class RPCClient:
|
|||
import socket
|
||||
try:
|
||||
socket.create_connection((host, port), timeout=1).close()
|
||||
except:
|
||||
except ConnectionError:
|
||||
die('SocketError', f'Unable to connect to {host}:{port}')
|
||||
|
||||
self.http_hdrs = {'Content-Type': 'application/json'}
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ def port_in_use(port):
|
|||
import socket
|
||||
try:
|
||||
socket.create_connection(('localhost', port)).close()
|
||||
except:
|
||||
except ConnectionError:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
|
|
|||
Loading…
Reference in a new issue