mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-30 14:21:26 -07:00
Update bare exceptions to specify Exception.
This will keep us from accidentally catching program-exiting exceptions like KeyboardInterupt and SystemExit.
This commit is contained in:
parent
5147e792d3
commit
3fba006207
320 changed files with 659 additions and 656 deletions
|
@ -68,7 +68,7 @@ class TestLookupModule:
|
|||
mock_response = MagicMock(spec_set=http_client.HTTPResponse)
|
||||
try:
|
||||
mock_response.getcode.return_value = 200
|
||||
except:
|
||||
except Exception:
|
||||
# HTTPResponse is a Python 3 only feature. This uses a generic mock for python 2.6
|
||||
mock_response = MagicMock()
|
||||
mock_response.getcode.return_value = 200
|
||||
|
@ -83,7 +83,7 @@ class TestLookupModule:
|
|||
mock_response = MagicMock(spec_set=http_client.HTTPResponse)
|
||||
try:
|
||||
mock_response.getcode.return_value = 200
|
||||
except:
|
||||
except Exception:
|
||||
# HTTPResponse is a Python 3 only feature. This uses a generic mock for python 2.6
|
||||
mock_response = MagicMock()
|
||||
mock_response.getcode.return_value = 200
|
||||
|
@ -99,7 +99,7 @@ class TestLookupModule:
|
|||
mock_response = MagicMock(spec_set=http_client.HTTPResponse)
|
||||
try:
|
||||
mock_response.getcode.return_value = code
|
||||
except:
|
||||
except Exception:
|
||||
# HTTPResponse is a Python 3 only feature. This uses a generic mock for python 2.6
|
||||
mock_response = MagicMock()
|
||||
mock_response.getcode.return_value = code
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue