##// END OF EJS Templates
dispatch: only do __import__(debugger) when a debugger is requested...
Jordi Gutiérrez Hermoso -
r20826:dd2e25e4 stable
parent child Browse files
Show More
@@ -108,13 +108,17 b' def _runcatch(req):'
108
108
109 # if we are in HGPLAIN mode, then disable custom debugging
109 # if we are in HGPLAIN mode, then disable custom debugging
110 debugger = ui.config("ui", "debugger")
110 debugger = ui.config("ui", "debugger")
111 debugmod = pdb
111 if not debugger or ui.plain():
112 if not debugger or ui.plain():
112 debugger = 'pdb'
113 debugger = 'pdb'
113
114 elif '--debugger' in req.args:
115 # This import can be slow for fancy debuggers, so only
116 # do it when absolutely necessary, i.e. when actual
117 # debugging has been requested
114 try:
118 try:
115 debugmod = __import__(debugger)
119 debugmod = __import__(debugger)
116 except ImportError:
120 except ImportError:
117 debugmod = pdb
121 pass # Leave debugmod = pdb
118
122
119 debugtrace[debugger] = debugmod.set_trace
123 debugtrace[debugger] = debugmod.set_trace
120 debugmortem[debugger] = debugmod.post_mortem
124 debugmortem[debugger] = debugmod.post_mortem
General Comments 0
You need to be logged in to leave comments. Login now