Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.0, 1.0.1, and 1.0.2

stable gdialog: fix circular import dependency

This has been reported three different times, but I only now just recognized
what the problem was. gdialog imports hgcmd, which imports hgthread, which
imports gdialog. If demandimport is disabled (many hg extensions have this
side-effect), hgtk crashes with a traceback that ends with:

File "tortoisehg\hgtk\gdialog.pyo", line 24, in <module>
File "zipextimporter.pyo", line 82, in load_module
File "tortoisehg\hgtk\hgcmd.pyo", line 20, in <module>
File "zipextimporter.pyo", line 82, in load_module
File "tortoisehg\hgtk\hgthread.pyo", line 18, in <module>
ImportError: cannot import name gdialog

Changeset d5ec833936a0

Parent dde4ab1f523d

by Steve Borho

Changes to one file · Browse files at d5ec833936a0 Showing diff from parent dde4ab1f523d Diff from another changeset...

 
21
22
23
24
 
25
26
27
 
787
788
789
 
790
791
792
 
21
22
23
 
24
25
26
27
 
787
788
789
790
791
792
793
@@ -21,7 +21,7 @@
 from tortoisehg.util.i18n import _  from tortoisehg.util import settings, hglib, paths, shlib   -from tortoisehg.hgtk import gtklib, hgcmd +from tortoisehg.hgtk import gtklib    class SimpleMessage(gtklib.MessageDialog):   def run(self): @@ -787,6 +787,7 @@
  ### Internal Functions ###     def after_init(self): + from tortoisehg.hgtk import hgcmd   self.get_extras(self.vbox)     # CmdWidget