Skip to content

Commit 98d36ac

Browse files
saumil-dSaumil Dave
and
Saumil Dave
authored
Feat/py3.7 (#35)
* refactor to remove := operator * rm python 3.8+ requirement from docs Co-authored-by: Saumil Dave <[email protected]>
1 parent 47c4e23 commit 98d36ac

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

CONTRIBUTING.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Clone the repository:
8787

8888
- `$ git clone https://github.com/modzy/sdk-python.git`
8989

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:
9191

9292
- `$ conda create --name VIRTUAL_ENVIRON_NAME --file requirements_dev.txt -c conda-forge python=3.9`
9393
or for non-conda python distros:

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
[![installation](https://github.com/modzy/sdk-python/raw/main/install.gif)](https://asciinema.org/a/0lHaPxvXTrPTp1Bb6bNea1ZCG)
2222

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:
2424

2525
- `$ pip install modzy-sdk`
2626

modzy/_util.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,16 @@ def file_to_chunks(file_like, chunk_size):
5151
if hasattr(file, 'seekable') and file.seekable():
5252
file.seek(0)
5353

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):
5659
raise TypeError("the file object's 'read' function must return bytes not {}; "
5760
"files should be opened using binary mode 'rb'"
5861
.format(type(chunk).__name__))
59-
yield chunk
62+
else:
63+
yield chunk
6064

6165
if should_close:
6266
file.close()

0 commit comments

Comments
 (0)