diff options
Diffstat (limited to 'tests/functional/u/unused/unused_variable.py')
-rw-r--r-- | tests/functional/u/unused/unused_variable.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/functional/u/unused/unused_variable.py b/tests/functional/u/unused/unused_variable.py index 9dabe5b59..f15ae7557 100644 --- a/tests/functional/u/unused/unused_variable.py +++ b/tests/functional/u/unused/unused_variable.py @@ -199,3 +199,20 @@ def func6(): nonlocal_writer() assert a == 9, a + +def test_regression_8595(): + # pylint: disable=broad-exception-caught + import logging + def compute(): + pass + try: + compute() + error = False + except Exception as e: + logging.error(e) + error = True + if error: + try: + compute() + except Exception as e: # [unused-variable] + pass |