python-urlopen 0.0.4__tar.gz → 0.0.4.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-urlopen
3
- Version: 0.0.4
3
+ Version: 0.0.4.1
4
4
  Summary: Python urlopen wrapper.
5
5
  Home-page: https://github.com/ChenyangGao/web-mount-packs/tree/main/python-module/python-urlopen
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "python-urlopen"
3
- version = "0.0.4"
3
+ version = "0.0.4.1"
4
4
  description = "Python urlopen wrapper."
5
5
  authors = ["ChenyangGao <wosiwujm@gmail.com>"]
6
6
  license = "MIT"
@@ -209,7 +209,7 @@ def download(
209
209
  resp = urlopen(url, headers={**headers, "Range": "bytes=%d-" % filesize}, **urlopen_kwargs)
210
210
  if not is_range_request(resp):
211
211
  raise OSError(errno.EIO, f"range request failed: {url!r}")
212
- if reporthook:
212
+ if reporthook is not None:
213
213
  reporthook(filesize)
214
214
  elif resume:
215
215
  for _ in bio_skip_iter(resp, filesize, callback=reporthook):
@@ -219,7 +219,7 @@ def download(
219
219
  fdst_write = fdst.write
220
220
  while (chunk := fsrc_read(chunksize)):
221
221
  fdst_write(chunk)
222
- if reporthook:
222
+ if reporthook is not None:
223
223
  reporthook(len(chunk))
224
224
  finally:
225
225
  resp.close()
File without changes