From 5e434a9683912874f192dd89e0ac1ac039e8f47a Mon Sep 17 00:00:00 2001 From: haosenwang1018 <167664334+haosenwang1018@users.noreply.github.com> Date: Fri, 27 Feb 2026 02:47:19 +0000 Subject: [PATCH] fix: replace 3 bare except clauses with except Exception --- bottle.py | 2 +- test/test_outputfilter.py | 2 +- test/test_wsgi.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bottle.py b/bottle.py index cf1b2e533..35aa318f1 100755 --- a/bottle.py +++ b/bottle.py @@ -4482,7 +4482,7 @@ def wrapper(*args, **kwargs):

Exception:

%%try: %%exc = repr(e.exception) - %%except: + %%except Exception: %%exc = '' %% type(e.exception).__name__ %%end
{{exc}}
diff --git a/test/test_outputfilter.py b/test/test_outputfilter.py index 219bd15d9..2b6ca2ab2 100755 --- a/test/test_outputfilter.py +++ b/test/test_outputfilter.py @@ -190,7 +190,7 @@ def test(): return 'hello' try: c = self.urlopen('/cookie')['header'].get_all('Set-Cookie', '') - except: + except Exception: c = self.urlopen('/cookie')['header'].get('Set-Cookie', '').split(',') c = [x.strip() for x in c] self.assertTrue('b=b' in c) diff --git a/test/test_wsgi.py b/test/test_wsgi.py index 1310a4f07..d34281b05 100755 --- a/test/test_wsgi.py +++ b/test/test_wsgi.py @@ -164,7 +164,7 @@ def test(): return 'hello' try: c = self.urlopen('/cookie')['header'].get_all('Set-Cookie', '') - except: + except Exception: c = self.urlopen('/cookie')['header'].get('Set-Cookie', '').split(',') c = [x.strip() for x in c] self.assertTrue('b=b' in c)