From 53ecca3d745fa6740676a79df7ff9fd8433c407a Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Mon, 13 May 2019 22:23:22 +0000 Subject: [PATCH] fix notebook with unknown total fixes #743 --- tqdm/_tqdm_notebook.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tqdm/_tqdm_notebook.py b/tqdm/_tqdm_notebook.py index cd60f937..885a7069 100644 --- a/tqdm/_tqdm_notebook.py +++ b/tqdm/_tqdm_notebook.py @@ -209,8 +209,9 @@ class tqdm_notebook(tqdm): # Replace with IPython progress bar display (with correct total) unit_scale = 1 if self.unit_scale is True else self.unit_scale or 1 + total = self.total * unit_scale if self.total else self.total self.sp = self.status_printer( - self.fp, self.total * unit_scale, self.desc, self.ncols) + self.fp, total, self.desc, self.ncols) self.desc = None # trick to place description before the bar # Print initial bar state