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

@ -3056,7 +3056,7 @@ def anon_handle_list_builds(goptions, session, args):
dt = dateutil.parser.parse(val)
ts = time.mktime(dt.timetuple())
setattr(options, opt, ts)
except BaseException:
except Exception:
parser.error(_("Invalid time specification: %s") % val)
if options.before:
opts['completeBefore'] = getattr(options, 'before')
@ -4450,7 +4450,7 @@ def anon_handle_list_history(goptions, session, args):
dt = dateutil.parser.parse(val)
ts = time.mktime(dt.timetuple())
setattr(options, opt, ts)
except BaseException:
except Exception:
parser.error(_("Invalid time specification: %s") % val)
for opt in ('package', 'tag', 'build', 'editor', 'user', 'permission',
'cg', 'external_repo', 'build_target', 'group', 'before',