make manager.py less nested
This commit is contained in:
parent
477caf3c80
commit
07dfa0b170
1 changed files with 14 additions and 12 deletions
|
@ -173,18 +173,20 @@ class Manager(object):
|
||||||
self._statistics.clear()
|
self._statistics.clear()
|
||||||
|
|
||||||
def _send_control_data(self, data):
|
def _send_control_data(self, data):
|
||||||
if self._control_client_addr:
|
if not self._control_client_addr:
|
||||||
try:
|
return
|
||||||
self._control_socket.sendto(data, self._control_client_addr)
|
|
||||||
except (socket.error, OSError, IOError) as e:
|
try:
|
||||||
error_no = eventloop.errno_from_exception(e)
|
self._control_socket.sendto(data, self._control_client_addr)
|
||||||
if error_no in (errno.EAGAIN, errno.EINPROGRESS,
|
except (socket.error, OSError, IOError) as e:
|
||||||
errno.EWOULDBLOCK):
|
error_no = eventloop.errno_from_exception(e)
|
||||||
return
|
if error_no in (errno.EAGAIN, errno.EINPROGRESS,
|
||||||
else:
|
errno.EWOULDBLOCK):
|
||||||
shell.print_exception(e)
|
return
|
||||||
if self._config['verbose']:
|
else:
|
||||||
traceback.print_exc()
|
shell.print_exception(e)
|
||||||
|
if self._config['verbose']:
|
||||||
|
traceback.print_exc()
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self._loop.run()
|
self._loop.run()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue