Skip to content

Commit

Permalink
IntProgress NameError -> ImportError
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Jun 1, 2018
1 parent 97158de commit 0a49dba
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions tqdm/_tqdm_notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,20 @@ def status_printer(_, total=None, desc=None, ncols=None):
# fp = file

# Prepare IPython progress bar
if total:
pbar = IntProgress(min=0, max=total)
else: # No total? Show info style bar with no progress tqdm status
pbar = IntProgress(min=0, max=1)
pbar.value = 1
pbar.bar_style = 'info'
try:
if total:
pbar = IntProgress(min=0, max=total)
else: # No total? Show info style bar with no progress tqdm status
pbar = IntProgress(min=0, max=1)
pbar.value = 1
pbar.bar_style = 'info'
except NameError:
# #187 #451 #558
raise ImportError(
"IntProgress not found. Please update juputer and ipywidgets."
" See https://ipywidgets.readthedocs.io/en/stable"
"/user_install.html")

if desc:
pbar.description = desc
# Prepare status text
Expand Down

0 comments on commit 0a49dba

Please sign in to comment.