1. TortoiseHg
  2. TortoiseHg
  3. thg


Yuya Nishihara  committed 2339e63

thg: make sure to load threading module by main thread (fixes #1894)

threading must be loaded by main thread, but in some cases, it is loaded
inside CmdThread, which leads KeyError at exit.

Instead of excluding every module which depends on threading from demandimport,
I chose to load threading before demandimport.

  • Participants
  • Parent commits 1af5a62
  • Branches stable

Comments (0)

Files changed (1)

File thg Modified

View file
  • Ignore whitespace
  • Hide word diff
         if os.path.isdir(testpath) and hgpath not in sys.path:
             sys.path.insert(0, hgpath)
+# Make sure to load threading by main thread; otherwise, _MainThread instance
+# may have wrong thread id and results KeyError at exit.
+import threading
 from mercurial import demandimport