diff options
Diffstat (limited to 'Lib/test')
| -rw-r--r-- | Lib/test/pythoninfo.py | 2 | ||||
| -rw-r--r-- | Lib/test/test_cgitb.py | 2 | ||||
| -rw-r--r-- | Lib/test/test_class.py | 2 | ||||
| -rw-r--r-- | Lib/test/test_codecs.py | 2 | ||||
| -rw-r--r-- | Lib/test/test_decimal.py | 4 | ||||
| -rw-r--r-- | Lib/test/test_ftplib.py | 2 | ||||
| -rw-r--r-- | Lib/test/test_sys_settrace.py | 6 | ||||
| -rw-r--r-- | Lib/test/test_time.py | 2 | ||||
| -rw-r--r-- | Lib/test/test_traceback.py | 10 | ||||
| -rw-r--r-- | Lib/test/test_urllib2net.py | 2 | ||||
| -rw-r--r-- | Lib/test/test_uuid.py | 2 |
11 files changed, 18 insertions, 18 deletions
diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py index 797b3af7d3..eab82c3631 100644 --- a/Lib/test/pythoninfo.py +++ b/Lib/test/pythoninfo.py @@ -754,7 +754,7 @@ def collect_info(info): ): try: collect_func(info_add) - except Exception as exc: + except Exception: error = True print("ERROR: %s() failed" % (collect_func.__name__), file=sys.stderr) diff --git a/Lib/test/test_cgitb.py b/Lib/test/test_cgitb.py index e299ec3ec6..8991bc1ff3 100644 --- a/Lib/test/test_cgitb.py +++ b/Lib/test/test_cgitb.py @@ -31,7 +31,7 @@ class TestCgitb(unittest.TestCase): def test_text(self): try: raise ValueError("Hello World") - except ValueError as err: + except ValueError: text = cgitb.text(sys.exc_info()) self.assertIn("ValueError", text) self.assertIn("Hello World", text) diff --git a/Lib/test/test_class.py b/Lib/test/test_class.py index 456f1be30b..7524f58a3c 100644 --- a/Lib/test/test_class.py +++ b/Lib/test/test_class.py @@ -529,7 +529,7 @@ class ClassTests(unittest.TestCase): # In debug mode, printed XXX undetected error and # raises AttributeError I() - except AttributeError as x: + except AttributeError: pass else: self.fail("attribute error for I.__init__ got masked") diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py index e1638c1116..3aec34c7f1 100644 --- a/Lib/test/test_codecs.py +++ b/Lib/test/test_codecs.py @@ -11,7 +11,7 @@ from test import support try: import _testcapi -except ImportError as exc: +except ImportError: _testcapi = None try: diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py index 1f37b5372a..fe0cfc7b66 100644 --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -5600,13 +5600,13 @@ class SignatureTest(unittest.TestCase): args, kwds = mkargs(C, c_sig) try: getattr(c_type(9), attr)(*args, **kwds) - except Exception as err: + except Exception: raise TestFailed("invalid signature for %s: %s %s" % (c_func, args, kwds)) args, kwds = mkargs(P, p_sig) try: getattr(p_type(9), attr)(*args, **kwds) - except Exception as err: + except Exception: raise TestFailed("invalid signature for %s: %s %s" % (p_func, args, kwds)) doit('Decimal') diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index b0e46411a2..b8eef82b15 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -346,7 +346,7 @@ if ssl is not None: if err.args[0] in (ssl.SSL_ERROR_WANT_READ, ssl.SSL_ERROR_WANT_WRITE): return - except OSError as err: + except OSError: # Any "socket error" corresponds to a SSL_ERROR_SYSCALL return # from OpenSSL's SSL_shutdown(), corresponding to a # closed socket condition. See also: diff --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py index fdd789475d..d4e1ac2c83 100644 --- a/Lib/test/test_sys_settrace.py +++ b/Lib/test/test_sys_settrace.py @@ -161,8 +161,8 @@ def raises(): def test_raise(): try: raises() - except Exception as exc: - x = 1 + except Exception: + pass test_raise.events = [(0, 'call'), (1, 'line'), @@ -191,7 +191,7 @@ def _settrace_and_raise(tracefunc): def settrace_and_raise(tracefunc): try: _settrace_and_raise(tracefunc) - except RuntimeError as exc: + except RuntimeError: pass settrace_and_raise.events = [(2, 'exception'), diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py index 8d8d31e782..80e43fafad 100644 --- a/Lib/test/test_time.py +++ b/Lib/test/test_time.py @@ -825,7 +825,7 @@ class CPyTimeTestCase: try: result = pytime_converter(value, time_rnd) expected = expected_func(value) - except Exception as exc: + except Exception: self.fail("Error on timestamp conversion: %s" % debug_info) self.assertEqual(result, expected, diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py index 72dc7afb8c..7135d997d5 100644 --- a/Lib/test/test_traceback.py +++ b/Lib/test/test_traceback.py @@ -313,7 +313,7 @@ class TracebackFormatTests(unittest.TestCase): with captured_output("stderr") as stderr_f: try: f() - except RecursionError as exc: + except RecursionError: render_exc() else: self.fail("no recursion occurred") @@ -360,7 +360,7 @@ class TracebackFormatTests(unittest.TestCase): with captured_output("stderr") as stderr_g: try: g() - except ValueError as exc: + except ValueError: render_exc() else: self.fail("no value error was raised") @@ -396,7 +396,7 @@ class TracebackFormatTests(unittest.TestCase): with captured_output("stderr") as stderr_h: try: h() - except ValueError as exc: + except ValueError: render_exc() else: self.fail("no value error was raised") @@ -424,7 +424,7 @@ class TracebackFormatTests(unittest.TestCase): with captured_output("stderr") as stderr_g: try: g(traceback._RECURSIVE_CUTOFF) - except ValueError as exc: + except ValueError: render_exc() else: self.fail("no error raised") @@ -452,7 +452,7 @@ class TracebackFormatTests(unittest.TestCase): with captured_output("stderr") as stderr_g: try: g(traceback._RECURSIVE_CUTOFF + 1) - except ValueError as exc: + except ValueError: render_exc() else: self.fail("no error raised") diff --git a/Lib/test/test_urllib2net.py b/Lib/test/test_urllib2net.py index 040a2ce276..bb0500e12a 100644 --- a/Lib/test/test_urllib2net.py +++ b/Lib/test/test_urllib2net.py @@ -199,7 +199,7 @@ class OtherNetworkTests(unittest.TestCase): try: with urllib.request.urlopen(URL) as res: pass - except ValueError as e: + except ValueError: self.fail("urlopen failed for site not sending \ Connection:close") else: diff --git a/Lib/test/test_uuid.py b/Lib/test/test_uuid.py index ddf7e6dc1b..b76c60e1ce 100644 --- a/Lib/test/test_uuid.py +++ b/Lib/test/test_uuid.py @@ -471,7 +471,7 @@ class BaseTestUUID: # the value from too_large_getter above. try: self.uuid.uuid1(node=node) - except ValueError as e: + except ValueError: self.fail('uuid1 was given an invalid node ID') def test_uuid1(self): |
