Skip to content

Commit 5f5bc3b

Browse files
committed
fix typing
Signed-off-by: William Woodruff <william@yossarian.net>
1 parent 1f8d49f commit 5f5bc3b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cachecontrol/filewrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from typing import TYPE_CHECKING, Any, Callable
99

1010
if TYPE_CHECKING:
11+
from collections.abc import Buffer
1112
from http.client import HTTPResponse
1213

1314

@@ -31,7 +32,7 @@ class CallbackFileWrapper:
3132
"""
3233

3334
def __init__(
34-
self, fp: HTTPResponse, callback: Callable[[bytes], None] | None
35+
self, fp: HTTPResponse, callback: Callable[[Buffer], None] | None
3536
) -> None:
3637
self.__buf = NamedTemporaryFile("rb+", delete=True)
3738
self.__fp = fp
@@ -68,7 +69,6 @@ def __is_fp_closed(self) -> bool:
6869
return False
6970

7071
def _close(self) -> None:
71-
result: bytes | memoryview[int]
7272
if self.__callback:
7373
if self.__buf.tell() == 0:
7474
# Empty file:

0 commit comments

Comments
 (0)