File tree 3 files changed +9
-5
lines changed
3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ Clone the repository:
87
87
88
88
- `$ git clone https://github.com/modzy/sdk-python.git`
89
89
90
- Setup a virtual environment from the local git directory (NOTE: Requires Python >= 3.8) :
90
+ Setup a virtual environment from the local git directory:
91
91
92
92
- `$ conda create --name VIRTUAL_ENVIRON_NAME --file requirements_dev.txt -c conda-forge python=3.9`
93
93
or for non-conda python distros:
Original file line number Diff line number Diff line change 20
20
21
21
[ ![ installation] ( https://github.com/modzy/sdk-python/raw/main/install.gif )] ( https://asciinema.org/a/0lHaPxvXTrPTp1Bb6bNea1ZCG )
22
22
23
- Use the package manager [ pip] ( https://pip.pypa.io/en/stable/ ) to install the SDK (NOTE: Requires Python >= 3.8) :
23
+ Use the package manager [ pip] ( https://pip.pypa.io/en/stable/ ) to install the SDK:
24
24
25
25
- ` $ pip install modzy-sdk `
26
26
Original file line number Diff line number Diff line change @@ -51,12 +51,16 @@ def file_to_chunks(file_like, chunk_size):
51
51
if hasattr (file , 'seekable' ) and file .seekable ():
52
52
file .seek (0 )
53
53
54
- while chunk := file .read (chunk_size ):
55
- if not isinstance (chunk , bytes ):
54
+ while True :
55
+ chunk = file .read (chunk_size )
56
+ if not chunk :
57
+ break
58
+ elif not isinstance (chunk , bytes ):
56
59
raise TypeError ("the file object's 'read' function must return bytes not {}; "
57
60
"files should be opened using binary mode 'rb'"
58
61
.format (type (chunk ).__name__ ))
59
- yield chunk
62
+ else :
63
+ yield chunk
60
64
61
65
if should_close :
62
66
file .close ()
You can’t perform that action at this time.
0 commit comments