Skip to content

Commit

Permalink
do not crash when -Syu is run in a non-tty
Browse files Browse the repository at this point in the history
Signed-off-by: Chris “Kwpolska” Warrick <[email protected]>
  • Loading branch information
Kwpolska committed Jan 2, 2014
1 parent 8b28db6 commit ba17e0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkgbuilder/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ def auto_upgrade(downgrade=False, vcsup=False):
if DS.pacman:
targetstring = _('Targets ({0}): ').format(upglen)

size = subprocess.check_output(['stty', 'size'])
try:
size = subprocess.check_output(['stty', 'size'])
termwidth = int(size.split()[1])
except IndexError:
except (IndexError, subprocess.CalledProcessError):
if verbosepkglists:
# Pacman doesn’t allow tables if the terminal is too small.
# And since we don’t know the size, better safe than sorry.
Expand Down

0 comments on commit ba17e0c

Please sign in to comment.