contrib/debugshell.py
changeset 27721 e4b512bb6386
parent 21243 8b5c039f2b4f
child 28476 e28dc6de38e7
--- a/contrib/debugshell.py	Mon Jan 04 10:13:29 2016 -0800
+++ b/contrib/debugshell.py	Mon Jan 11 18:16:38 2016 -0800
@@ -4,7 +4,10 @@
 import sys
 import mercurial
 import code
-from mercurial import cmdutil
+from mercurial import (
+    cmdutil,
+    demandimport,
+)
 
 cmdtable = {}
 command = cmdutil.command(cmdtable)
@@ -45,7 +48,8 @@
 
     # if IPython doesn't exist, fallback to code.interact
     try:
-        __import__(pdbmap[debugger])
+        with demandimport.deactivated():
+            __import__(pdbmap[debugger])
     except ImportError:
         ui.warn("%s debugger specified but %s module was not found\n"
                 % (debugger, pdbmap[debugger]))