diff --git a/tqdm/std.py b/tqdm/std.py index 70026348..17bc5c6f 100644 --- a/tqdm/std.py +++ b/tqdm/std.py @@ -1330,6 +1330,8 @@ class tqdm(Comparable): def unpause(self): """Restart tqdm timer from last print time.""" + if self.disable: + return cur_t = self._time() self.start_t += cur_t - self.last_print_t self.last_print_t = cur_t @@ -1344,13 +1346,16 @@ class tqdm(Comparable): ---------- total : int or float, optional. Total to use for the new bar. """ - self.last_print_n = self.n = 0 + self.n = 0 + if total is not None: + self.total = total + if self.disable: + return + self.last_print_n = 0 self.last_print_t = self.start_t = self._time() self._ema_dn = EMA(self.smoothing) self._ema_dt = EMA(self.smoothing) self._ema_miniters = EMA(self.smoothing) - if total is not None: - self.total = total self.refresh() def set_description(self, desc=None, refresh=True):