Skip to content

Commit 83384fb

Browse files
committed
mypy
1 parent 022fef0 commit 83384fb

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/unstructured_client/basesdk.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,15 @@ async def cleanup_cancelled_request(
313313
) -> None:
314314
if req is None and response is None:
315315
return
316+
cleanup_request = req
317+
if cleanup_request is None and response is not None:
318+
cleanup_request = response.request
319+
assert cleanup_request is not None
316320
try:
317321
await hooks.after_error_async(
318322
AfterErrorContext(hook_ctx),
319323
response,
320-
_RequestBoundCancelledError(req or response.request, cancellation),
324+
_RequestBoundCancelledError(cleanup_request, cancellation),
321325
)
322326
except Exception:
323327
logger.debug("Cancellation cleanup failed", exc_info=True)

0 commit comments

Comments
 (0)