diff roundup/cgi/client.py @ 6976:3917ae82fb24

flake8 - bare exceptions Converted two nested fallback capture any exception handlers from "except:" into "except Exception" and one into 'except ValueError' to handle a non-int passed to int().
author John Rouillard <rouilj@ieee.org>
date Wed, 14 Sep 2022 16:06:29 -0400
parents fe4a6ba98bfe
children ff2c8b430738
line wrap: on
line diff
--- a/roundup/cgi/client.py	Wed Sep 14 15:59:59 2022 -0400
+++ b/roundup/cgi/client.py	Wed Sep 14 16:06:29 2022 -0400
@@ -2076,7 +2076,7 @@
             return '<strong>%s</strong>' % html_escape(str(message))
         except templating.Unauthorised as message:
             raise Unauthorised(html_escape(str(message)))
-        except:
+        except Exception:
             # everything else
             if self.instance.config.WEB_DEBUG:
                 return cgitb.pt_html(i18n=self.translator)
@@ -2088,7 +2088,7 @@
                 self.send_error_to_admin(subject, cgitb.pt_html(), format_exc())
                 # Now report the error to the user.
                 return self._(default_err_msg)
-            except:
+            except Exception:
                 # Reraise the original exception.  The user will
                 # receive an error message, and the adminstrator will
                 # receive a traceback, albeit with less information
@@ -2523,7 +2523,7 @@
                 last = int(last)
             else:
                 last = length - 1
-        except:
+        except ValueError:
             # The positions could not be parsed as integers.
             return None
         # Check that the range makes sense.

Roundup Issue Tracker: http://roundup-tracker.org/