use Exception instead of BaseException for bare expection

This commit is contained in:
Yuming Zhu 2020-03-02 18:27:24 +08:00
parent b3b0c8d51e
commit cf34706f04
21 changed files with 70 additions and 70 deletions

View file

@ -303,10 +303,10 @@ class GenericError(Exception):
def __str__(self):
try:
return str(self.args[0]['args'][0])
except BaseException:
except Exception:
try:
return str(self.args[0])
except BaseException:
except Exception:
return str(self.__dict__)
# END kojikamid dup #
@ -1730,7 +1730,7 @@ def format_exc_plus():
# COULD cause any exception, so we MUST catch any...:
try:
rv += "%s\n" % value
except BaseException:
except Exception:
rv += "<ERROR WHILE PRINTING VALUE>\n"
return rv
@ -2273,7 +2273,7 @@ class VirtualMethod(object):
self.__session._apidoc = dict(
[(f["name"], f) for f in self.__func("_listapi", [], {})]
)
except BaseException:
except Exception:
self.__session._apidoc = {}
funcdoc = self.__session._apidoc.get(self.__name)
@ -2659,7 +2659,7 @@ class ClientSession(object):
if self.__dict__:
try:
self.logout()
except BaseException:
except Exception:
pass
def callMethod(self, name, *args, **opts):
@ -3303,7 +3303,7 @@ class DBHandler(logging.Handler):
# self.cnx.commit()
# XXX - committing here is most likely wrong, but we need to set commit_pending or
# something...and this is really the wrong place for that
except BaseException:
except Exception:
self.handleError(record)