mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-125522 : add explicit exception types to bare excepts in tests (#125523)
This commit is contained in:
parent
c9826c11db
commit
e97910cdb7
11 changed files with 38 additions and 38 deletions
|
@ -609,7 +609,7 @@ class ListComprehensionTest(unittest.TestCase):
|
|||
result = snapshot = None
|
||||
try:
|
||||
result = [{func}(value) for value in value]
|
||||
except:
|
||||
except ValueError:
|
||||
snapshot = value
|
||||
raise
|
||||
"""
|
||||
|
@ -643,7 +643,7 @@ class ListComprehensionTest(unittest.TestCase):
|
|||
value = [1, None]
|
||||
try:
|
||||
[v for v in value].sort()
|
||||
except:
|
||||
except TypeError:
|
||||
pass
|
||||
"""
|
||||
self._check_in_scopes(code, {"value": [1, None]})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue