Skip to content

Commit

Permalink
Fixed division by zero in transfers.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Jul 7, 2015
1 parent 4626a29 commit 40a5f03
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
TradeDangerous, Copyright (C) Oliver "kfsone" Smith, July 2014
==============================================================================

Jul 07 2015:
. (kfsone) Fixed division by zero in transfers.py with empty file

v7.3.0 Jul 05 2015:
. (ahamid/kfsone) "fromfile" support for command options:
- All commands will now look for a "fromfile" specifying default arguments
Expand Down
3 changes: 2 additions & 1 deletion transfers.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,11 @@ def download(
tdenv.DEBUG0("End of data")
if not tdenv.quiet:
progBar.clear()
elapsed = (time.time() - started) or 1
tdenv.NOTE(
"Downloaded {} of {}ed data {}/s",
makeUnit(fetched), encoding,
makeUnit(fetched / (time.time() - started))
makeUnit(fetched / elapsed)
)

# Swap the file into place
Expand Down

0 comments on commit 40a5f03

Please sign in to comment.