解决python3.12 RuntimeError: cannot join thread before it is started的报错
(self)
| 17 | """ |
| 18 | |
| 19 | def start(self) -> None: |
| 20 | """ |
| 21 | 解决python3.12 RuntimeError: cannot join thread before it is started的报错 |
| 22 | """ |
| 23 | super().start() |
| 24 | |
| 25 | if sys.version_info.minor >= 12 and sys.version_info.major >= 3: |
| 26 | for thread in threading.enumerate(): |
| 27 | if ( |
| 28 | thread.daemon |
| 29 | or thread is threading.current_thread() |
| 30 | or not thread.is_alive() |
| 31 | ): |
| 32 | continue |
| 33 | thread.join() |