Skip to content

Commit

Permalink
py3 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Sep 30, 2017
1 parent 1259f68 commit 1aa4304
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tqdm/_tqdm.py
Expand Up @@ -325,7 +325,7 @@ def format_meter(n, total, elapsed, ncols=None, prefix='', ascii=False,
rate_inv_fmt = ((format_sizeof(inv_rate) if unit_scale else
'{0:5.2f}'.format(inv_rate))
if inv_rate else '?') + 's/' + unit
rate_fmt = rate_inv_fmt if inv_rate > 1 else rate_noinv_fmt
rate_fmt = rate_inv_fmt if inv_rate and inv_rate > 1 else rate_noinv_fmt

if unit_scale:
n_fmt = format_sizeof(n, divisor=unit_divisor)
Expand Down Expand Up @@ -367,7 +367,8 @@ def format_meter(n, total, elapsed, ncols=None, prefix='', ascii=False,
'total': total,
'total_fmt': total_fmt,
'percentage': percentage,
'rate': inv_rate if inv_rate > 1 else rate,
'rate': inv_rate if inv_rate and inv_rate > 1
else rate,
'rate_fmt': rate_fmt,
'rate_noinv': rate,
'rate_noinv_fmt': rate_noinv_fmt,
Expand Down

0 comments on commit 1aa4304

Please sign in to comment.