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:
Wolfgang Walther
2026-06-14 17:18:37 +00:00
parent 6d87fc5879
commit f24bc7092f
+2
View File
@@ -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)