test(io): fix UnboundLocalError
The `if response` check a few rows down would not actually work without initializing the variable first. It'd throw: ``` E UnboundLocalError: cannot access local variable 'response' where it is not associated with a value ```
This commit is contained in:
@@ -250,6 +250,8 @@ def wait_until_status_code(url, max_seconds, status_code):
|
||||
"Wait for the given HTTP endpoint to return a status code"
|
||||
session = requests_unixsocket.Session()
|
||||
|
||||
response = None
|
||||
|
||||
for _ in range(max_seconds * 10):
|
||||
try:
|
||||
response = session.get(url, timeout=1)
|
||||
|
||||
Reference in New Issue
Block a user