Correct reraising of exception

When an exception was caught and rethrown, it should call 'raise'
without any arguments because it shows the place where an exception
occured initially instead of place where the exception re-raised.

Change-Id: I326dd8eaf221cbf3729beedaff81b416c59ae2e6
This commit is contained in:
yuyafei 2016-07-07 18:27:21 +08:00
parent 561284e3d4
commit b53214e30b
2 changed files with 2 additions and 2 deletions

View File

@ -316,7 +316,7 @@ class Manager(object):
except OSError as e:
# PID died before kill_group can take action?
if e.errno != errno.ESRCH:
raise e
raise
else:
print(_('Waited %(kill_wait)s seconds for %(server)s '
'to die; giving up') %

View File

@ -1727,7 +1727,7 @@ def get_logger(conf, name=None, log_to_console=False, log_route=None,
except socket.error as e:
# Either /dev/log isn't a UNIX socket or it does not exist at all
if e.errno not in [errno.ENOTSOCK, errno.ENOENT]:
raise e
raise
handler = SysLogHandler(facility=facility)
handler.setFormatter(formatter)
logger.addHandler(handler)