From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sat, 19 Oct 2024 12:07:16 +0000 (+0200) Subject: [3.12] gh-125522: Fix bare except in test_math.testTan (GH-125544) (#125727) X-Git-Tag: v3.12.8~187 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5f6e1120e3ba21d5140e91737386e46a22ffb5ea;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-125522: Fix bare except in test_math.testTan (GH-125544) (#125727) gh-125522: Fix bare except in test_math.testTan (GH-125544) (cherry picked from commit 4b421e8aca7f2dccc5ac8604b78589941dd7974c) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> --- diff --git a/Lib/test/test_math.py b/Lib/test/test_math.py index 7e403f7ef258..600946eeb827 100644 --- a/Lib/test/test_math.py +++ b/Lib/test/test_math.py @@ -1886,7 +1886,7 @@ class MathTests(unittest.TestCase): try: self.assertTrue(math.isnan(math.tan(INF))) self.assertTrue(math.isnan(math.tan(NINF))) - except: + except ValueError: self.assertRaises(ValueError, math.tan, INF) self.assertRaises(ValueError, math.tan, NINF) self.assertTrue(math.isnan(math.tan(NAN)))