From 73238157c386530926dbc1507815387c146dce1a Mon Sep 17 00:00:00 2001 From: Ganden Schaffner Date: Wed, 15 Feb 2023 18:50:08 -0800 Subject: [PATCH] Fix B029 typo (#355) --- README.rst | 4 ++-- bugbear.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 0bf2b4b..57c4503 100644 --- a/README.rst +++ b/README.rst @@ -177,7 +177,7 @@ limitations make it difficult. stacklevel of 1 by default. This will only show a stack trace for the line on which the warn method is called. It is therefore recommended to use a stacklevel of 2 or greater to provide more information to the user. -**B029**: Using ``except: ()`` with an empty tuple does not handle/catch anything. Add exceptions to handle. +**B029**: Using ``except ():`` with an empty tuple does not handle/catch anything. Add exceptions to handle. **B030**: Except handlers should only be exception classes or tuples of exception classes. @@ -334,7 +334,7 @@ Change Log order to maintain backwards compatibility with Python 3.7. * B016: Warn when raising f-strings. * Add B028: Check for an explicit stacklevel keyword argument on the warn method from the warnings module. -* Add B029: Check when trying to use ``except`` with an empty tuple i.e. ``except: ()``. +* Add B029: Check when trying to use ``except`` with an empty tuple i.e. ``except ():``. * Add B030: Check that except handlers only use exception classes or tuples of exception classes. Fixes crash on some rare except handlers. * Add B031: Check that ``itertools.groupby()`` is not used multiple times. diff --git a/bugbear.py b/bugbear.py index dc1f2c0..c6df967 100644 --- a/bugbear.py +++ b/bugbear.py @@ -1629,7 +1629,7 @@ def visit_Lambda(self, node): ) B029 = Error( message=( - "B029 Using `except: ()` with an empty tuple does not handle/catch " + "B029 Using `except ():` with an empty tuple does not handle/catch " "anything. Add exceptions to handle." ) )