问题描述:需要同时运行2个方法, # interface_process.run_usb_random_write()
# usb_mapping_test.main(is_flag) 测试是可以正常运行成功的。但是会报错。
class Test:
def main(self, is_flag, case_list):
usb_path = tools.get_usb_dispart()
usb_mapping_test = UsbMappingTest()
usb_rep_insertion = UsbRepInsertion()
if "writing_dis_usb" in case_list:
is_flag = False
# interface_process.run_usb_random_write()
# usb_mapping_test.main(is_flag)
thread1 = threading.Thread(target=interface_process.run_usb_random_write)
thread2 = threading.Thread(target=usb_mapping_test.main, args=(is_flag,))
thread1.start()
thread2.start()
thread1.join()
thread2.join()
报错信息如下
Exception ignored in: <function Image.__del__ at 0x000002703819A670>
Traceback (most recent call last):
File "H:\software\miniconda3\envs\py3.8\lib\tkinter\__init__.py", line 4017, in __del__
self.tk.call('image', 'delete', self.name)
RuntimeError: main thread is not in main loop
Exception ignored in: <function Variable.__del__ at 0x000002703815DD30>
Traceback (most recent call last):
File "H:\software\miniconda3\envs\py3.8\lib\tkinter\__init__.py", line 363, in __del__
if self._tk.getboolean(self._tk.call("info", "exists", self._name)):
RuntimeError: main thread is not in main loop
Exception ignored in: <function Variable.__del__ at 0x000002703815DD30>
Traceback (most recent call last):
File "H:\software\miniconda3\envs\py3.8\lib\tkinter\__init__.py", line 363, in __del__
if self._tk.getboolean(self._tk.call("info", "exists", self._name)):
RuntimeError: main thread is not in main loop
Exception ignored in: <function Variable.__del__ at 0x000002703815DD30>
Traceback (most recent call last):
File "H:\software\miniconda3\envs\py3.8\lib\tkinter\__init__.py", line 363, in __del__
if self._tk.getboolean(self._tk.call("info", "exists", self._name)):
RuntimeError: main thread is not in main loop
Exception ignored in: <function Variable.__del__ at 0x000002703815DD30>
Traceback (most recent call last):
File "H:\software\miniconda3\envs\py3.8\lib\tkinter\__init__.py", line 363, in __del__
if self._tk.getboolean(self._tk.call("info", "exists", self._name)):
RuntimeError: main thread is not in main loop
Tcl_AsyncDelete: async handler deleted by the wrong thread