File tree 2 files changed +5
-12
lines changed
2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ def __getstate__(self) -> dict[str, Any]:
144
144
del state ["cache" ]
145
145
return state
146
146
147
- def __setstate__ (self , state ) -> None :
147
+ def __setstate__ (self , state : dict [ str , Any ] ) -> None :
148
148
# Restore instance attributes
149
149
self .__dict__ .update (state )
150
150
self .cache = self ._makefile ()
@@ -278,7 +278,7 @@ def __getstate__(self) -> dict[str, Any]:
278
278
del state ["_fetch_block_cached" ]
279
279
return state
280
280
281
- def __setstate__ (self , state ) -> None :
281
+ def __setstate__ (self , state : dict [ str , Any ] ) -> None :
282
282
self .__dict__ .update (state )
283
283
self ._fetch_block_cached = functools .lru_cache (state ["maxblocks" ])(
284
284
self ._fetch_block
@@ -471,10 +471,6 @@ def __init__(
471
471
self .data = data
472
472
473
473
def _fetch (self , start : int | None , stop : int | None ) -> bytes :
474
- if start is None :
475
- start = 0
476
- if stop is None :
477
- stop = len (self .data )
478
474
return self .data [start :stop ]
479
475
480
476
Original file line number Diff line number Diff line change @@ -296,10 +296,7 @@ def read_block(
296
296
length = end - start
297
297
298
298
f .seek (offset )
299
- if length is not None :
300
- b = f .read (length )
301
- else :
302
- b = f .read ()
299
+ b = f .read (length ) # type: ignore[arg-type]
303
300
return b
304
301
305
302
@@ -348,14 +345,14 @@ def stringify_path(filepath: str | os.PathLike[str] | pathlib.Path) -> str:
348
345
"""
349
346
if isinstance (filepath , str ):
350
347
return filepath
351
- elif hasattr (filepath , "__fspath__" ) or isinstance ( filepath , os . PathLike ) :
348
+ elif hasattr (filepath , "__fspath__" ):
352
349
return filepath .__fspath__ ()
353
350
elif isinstance (filepath , pathlib .Path ):
354
351
return str (filepath )
355
352
elif hasattr (filepath , "path" ):
356
353
return filepath .path
357
354
else :
358
- return filepath
355
+ return filepath # type: ignore[return-value]
359
356
360
357
361
358
def make_instance (
You can’t perform that action at this time.
0 commit comments