Skip to content

Commit

Permalink
Check reporthook is not None before calling it (keras-team#8320)
Browse files Browse the repository at this point in the history
  • Loading branch information
farizrahman4u authored and fchollet committed Oct 31, 2017
1 parent ee4b0bc commit abccbba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion keras/utils/data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ def chunk_read(response, chunk_size=8192, reporthook=None):
chunk = response.read(chunk_size)
count += 1
if not chunk:
reporthook(count, total_size, total_size)
if reporthook:
reporthook(count, total_size, total_size)
break
if reporthook:
reporthook(count, chunk_size, total_size)
Expand Down

0 comments on commit abccbba

Please sign in to comment.