python-filewrap 0.2.8.2__tar.gz → 0.2.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_filewrap-0.2.8.2 → python_filewrap-0.2.9}/PKG-INFO +1 -1
- {python_filewrap-0.2.8.2 → python_filewrap-0.2.9}/filewrap/__init__.py +9 -1
- {python_filewrap-0.2.8.2 → python_filewrap-0.2.9}/pyproject.toml +1 -1
- {python_filewrap-0.2.8.2 → python_filewrap-0.2.9}/LICENSE +0 -0
- {python_filewrap-0.2.8.2 → python_filewrap-0.2.9}/filewrap/py.typed +0 -0
- {python_filewrap-0.2.8.2 → python_filewrap-0.2.9}/readme.md +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# encoding: utf-8
|
|
3
3
|
|
|
4
4
|
__author__ = "ChenyangGao <https://chenyanggao.github.io>"
|
|
5
|
-
__version__ = (0, 2,
|
|
5
|
+
__version__ = (0, 2, 9)
|
|
6
6
|
__all__ = [
|
|
7
7
|
"SupportsRead", "SupportsReadinto", "SupportsWrite", "SupportsSeek",
|
|
8
8
|
"AsyncBufferedReader", "AsyncTextIOWrapper", "buffer_length",
|
|
@@ -864,6 +864,8 @@ def bio_chunk_iter(
|
|
|
864
864
|
if size < chunksize:
|
|
865
865
|
del buf[size:]
|
|
866
866
|
length = readinto(buf)
|
|
867
|
+
if not length:
|
|
868
|
+
return
|
|
867
869
|
if callback:
|
|
868
870
|
callback(length)
|
|
869
871
|
if length < buffer_length(buf):
|
|
@@ -887,6 +889,8 @@ def bio_chunk_iter(
|
|
|
887
889
|
readsize = min(chunksize, size)
|
|
888
890
|
chunk = read(readsize)
|
|
889
891
|
length = buffer_length(chunk)
|
|
892
|
+
if not length:
|
|
893
|
+
return
|
|
890
894
|
if callback:
|
|
891
895
|
callback(length)
|
|
892
896
|
yield chunk
|
|
@@ -932,6 +936,8 @@ async def bio_chunk_async_iter(
|
|
|
932
936
|
if size < chunksize:
|
|
933
937
|
del buf[size:]
|
|
934
938
|
length = await readinto(buf)
|
|
939
|
+
if not length:
|
|
940
|
+
return
|
|
935
941
|
if callback:
|
|
936
942
|
await callback(length)
|
|
937
943
|
if length < buffer_length(buf):
|
|
@@ -955,6 +961,8 @@ async def bio_chunk_async_iter(
|
|
|
955
961
|
readsize = min(chunksize, size)
|
|
956
962
|
chunk = await read(readsize)
|
|
957
963
|
length = buffer_length(chunk)
|
|
964
|
+
if not length:
|
|
965
|
+
return
|
|
958
966
|
if callback:
|
|
959
967
|
await callback(length)
|
|
960
968
|
yield chunk
|
|
File without changes
|
|
File without changes
|
|
File without changes
|