Skip to content

Commit 4503f5a

Browse files
committed
fix typing in pygit2/blob.py
1 parent 5911b0c commit 4503f5a

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

pygit2/_pygit2.pyi

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
from typing import Iterator, Literal, Optional, overload, Type, TypedDict
2-
from io import IOBase
2+
from io import IOBase, DEFAULT_BUFFER_SIZE
3+
from queue import Queue
4+
from threading import Event
35
from . import Index
46
from .enums import (
57
ApplyLocation,
68
BranchType,
9+
BlobFilter,
710
DeltaStatus,
811
DiffFind,
912
DiffFlag,
@@ -355,6 +358,15 @@ class Blob(Object):
355358
old_as_path: str = ...,
356359
buffer_as_path: str = ...,
357360
) -> Patch: ...
361+
def _write_to_queue(
362+
self,
363+
queue: Queue,
364+
closed: Event,
365+
chunk_size: int = DEFAULT_BUFFER_SIZE,
366+
as_path: Optional[str] = None,
367+
flags: BlobFilter = BlobFilter.CHECK_FOR_BINARY,
368+
commit_id: Optional[Oid] = None,
369+
) -> None: ...
358370

359371
class Branch(Reference):
360372
branch_name: str

pygit2/blob.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __init__(
2626
):
2727
super().__init__()
2828
self._blob = blob
29-
self._queue = Queue(maxsize=1)
29+
self._queue: Optional[Queue] = Queue(maxsize=1)
3030
self._ready = threading.Event()
3131
self._writer_closed = threading.Event()
3232
self._chunk: Optional[bytes] = None
@@ -45,7 +45,7 @@ def __init__(
4545
def __exit__(self, exc_type, exc_value, traceback):
4646
self.close()
4747

48-
def isatty():
48+
def isatty(self):
4949
return False
5050

5151
def readable(self):

0 commit comments

Comments
 (0)