diff --git a/ae5_tools/api.py b/ae5_tools/api.py index 75d8ad8..456184e 100644 --- a/ae5_tools/api.py +++ b/ae5_tools/api.py @@ -202,8 +202,8 @@ def _response_hook(resp, *args, **kwargs): prefix = req.method.upper() if url == last_redirect: prefix = "-> " + prefix - print(prefix, re.sub('[?].*', '?...', url), code, file=sys.stderr) - last_redirect = resp.headers['location'] if 300 <= code < 400 else None + print(prefix, re.sub("[?].*", "?...", url), code, file=sys.stderr) + last_redirect = resp.headers["location"] if 300 <= code < 400 else None class EmptyRecordList(list): @@ -352,7 +352,7 @@ def _build_requests_session() -> Session: session.mount(prefix="https://", adapter=adapter) if get_env_var(name="API_DEBUG"): - session.hooks['response'].append(_response_hook) + session.hooks["response"].append(_response_hook) return session