61 sys.modules[fullname] = module |
61 sys.modules[fullname] = module |
62 |
62 |
63 ## Add hook for _thread.start_new_thread |
63 ## Add hook for _thread.start_new_thread |
64 if ( |
64 if ( |
65 fullname in ('thread', '_thread') and |
65 fullname in ('thread', '_thread') and |
66 not hasattr(module, 'eric6_patched') |
66 not hasattr(module, 'eric7_patched') |
67 ): |
67 ): |
68 module.eric6_patched = True |
68 module.eric7_patched = True |
69 self.__dbgClient.patchPyThread(module) |
69 self.__dbgClient.patchPyThread(module) |
70 |
70 |
71 ## Add hook for threading.run() |
71 ## Add hook for threading.run() |
72 elif ( |
72 elif ( |
73 fullname == "threading" and |
73 fullname == "threading" and |
74 not hasattr(module, 'eric6_patched') |
74 not hasattr(module, 'eric7_patched') |
75 ): |
75 ): |
76 module.eric6_patched = True |
76 module.eric7_patched = True |
77 self.__dbgClient.patchPyThreading(module) |
77 self.__dbgClient.patchPyThreading(module) |
78 |
78 |
79 ## greenlet support |
79 ## greenlet support |
80 elif ( |
80 elif ( |
81 fullname == 'greenlet' and |
81 fullname == 'greenlet' and |
82 not hasattr(module, 'eric6_patched') |
82 not hasattr(module, 'eric7_patched') |
83 ): |
83 ): |
84 if self.__dbgClient.patchGreenlet(module): |
84 if self.__dbgClient.patchGreenlet(module): |
85 module.eric6_patched = True |
85 module.eric7_patched = True |
86 |
86 |
87 ## Add hook for subprocess.Popen() |
87 ## Add hook for subprocess.Popen() |
88 elif ( |
88 elif ( |
89 fullname == 'subprocess' and |
89 fullname == 'subprocess' and |
90 not hasattr(module, 'eric6_patched') |
90 not hasattr(module, 'eric7_patched') |
91 ): |
91 ): |
92 module.eric6_patched = True |
92 module.eric7_patched = True |
93 patchSubprocess(module, self.__dbgClient) |
93 patchSubprocess(module, self.__dbgClient) |
94 |
94 |
95 ## Add hook for multiprocessing.Process |
95 ## Add hook for multiprocessing.Process |
96 elif ( |
96 elif ( |
97 fullname == 'multiprocessing' and |
97 fullname == 'multiprocessing' and |
98 not hasattr(module, 'eric6_patched') |
98 not hasattr(module, 'eric7_patched') |
99 ): |
99 ): |
100 module.eric6_patched = True |
100 module.eric7_patched = True |
101 patchMultiprocessing(module, self.__dbgClient) |
101 patchMultiprocessing(module, self.__dbgClient) |
102 |
102 |
103 ## Add hook for *.QThread and *.QProcess |
103 ## Add hook for *.QThread and *.QProcess |
104 elif ( |
104 elif ( |
105 fullname in ('PyQt5.QtCore', 'PyQt6.QtCore', |
105 fullname in ('PyQt5.QtCore', 'PyQt6.QtCore', |
106 'PySide2.QtCore', 'PySide6.QtCore') and |
106 'PySide2.QtCore', 'PySide6.QtCore') and |
107 not hasattr(module, 'eric6_patched') |
107 not hasattr(module, 'eric7_patched') |
108 ): |
108 ): |
109 module.eric6_patched = True |
109 module.eric7_patched = True |
110 self.__dbgClient.patchQThread(module) |
110 self.__dbgClient.patchQThread(module) |
111 patchQProcess(module, self.__dbgClient) |
111 patchQProcess(module, self.__dbgClient) |
112 |
112 |
113 self.__enableImportHooks = True |
113 self.__enableImportHooks = True |
114 return module |
114 return module |