[lib] do not swallow exception with ``--traceback`` (closes #89337)

authorAlain Leufroy <alain.leufroy@logilab.fr>
changesetc27a1eb98cab
branchstable
phasepublic
hiddenno
parent revision#487237792c36 [TUI|inotify] prevent over refreshing with mercurial 2.1 (closes #89336)
child revision#60c0dd913f22 merge stable in default, #e39ca4994b68 merge debian version 1.5.0-4
files modified by this revision
hgviewlib/application.py
# HG changeset patch
# User Alain Leufroy <alain.leufroy@logilab.fr>
# Date 1330112604 -3600
# Fri Feb 24 20:43:24 2012 +0100
# Branch stable
# Node ID c27a1eb98cab82f1ca1eca82639cbc1ec52dd16d
# Parent 487237792c36a166f0f94617b5cc575e2d66ccb3
[lib] do not swallow exception with ``--traceback`` (closes #89337)

diff --git a/hgviewlib/application.py b/hgviewlib/application.py
@@ -118,16 +118,20 @@
1      if not opts.interface or opts.interface == 'qt':
2          try:
3              from hgviewlib.qt4.application import HgViewQtApplication as Application
4              opts.interface = 'qt'
5          except ImportError:
6 +            if '--traceback' in sys.argv:
7 +                raise
8              pass
9      if not opts.interface or opts.interface in ('raw', 'curses'):
10          try:
11              from hgviewlib.curses.application import HgViewUrwidApplication as Application
12              opts.interface = 'raw'
13          except ImportError:
14 +            if '--traceback' in sys.argv:
15 +                raise
16              pass
17      if not opts.interface:
18          fnerror('No interface found')
19      if not Application:
20          fnerror('Interface is not available: %s' % opts.interface)