Skip to content

Commit

Permalink
'Refactored by Sourcery'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourcery AI committed Sep 13, 2021
1 parent cd042ba commit 989e110
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions tqdm/std.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ def __init__(self, iterable=None, desc=None, total=None, leave=True, file=None,
if ascii is None:
ascii = not _supports_unicode(file)

if bar_format and not ((ascii is True) or _is_ascii(ascii)):
if bar_format and ascii is not True and not _is_ascii(ascii):
# Convert bar format into unicode since terminal uses unicode
bar_format = _unicode(bar_format)

Expand Down Expand Up @@ -1102,11 +1102,7 @@ def __init__(self, iterable=None, desc=None, total=None, leave=True, file=None,
# if nested, at initial sp() call we replace '\r' by '\n' to
# not overwrite the outer progress bar
with self._lock:
if position is None:
self.pos = self._get_free_pos(self)
else: # mark fixed positions as negative
self.pos = -position

self.pos = self._get_free_pos(self) if position is None else -position
if not gui:
# Initialize the screen printer
self.sp = self.status_printer(self.fp)
Expand Down Expand Up @@ -1170,8 +1166,7 @@ def __iter__(self):
# If the bar is disabled, then just walk the iterable
# (note: keep this check outside the loop for performance)
if self.disable:
for obj in iterable:
yield obj
yield from iterable
return

mininterval = self.mininterval
Expand Down

0 comments on commit 989e110

Please sign in to comment.