Skip to content

Commit

Permalink
fix: add callable check to progress_bar
Browse files Browse the repository at this point in the history
If `progress_func` is `None` a `TypeError` (`TypeError: 'NoneType'
object is not callable`) is raised. Add check to verify that
`progress_func` is callable.

Fixes #378.
  • Loading branch information
Maximilian Strobel authored and allburov committed Sep 13, 2022
1 parent 1b2d87b commit 7d6b6e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion artifactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -1422,7 +1422,7 @@ def writeto(self, pathobj, file, chunk_size, progress_func):

file.write(chunk)

if real_chunk > 0:
if callable(progress_func) and real_chunk > 0:
progress_func(bytes_read + real_chunk, file_size)


Expand Down

0 comments on commit 7d6b6e8

Please sign in to comment.