mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
bpo-31516: current_thread() should not return a dummy thread at shutdown (#3673)
bpo-31516: current_thread() should not return a dummy thread at shutdown
This commit is contained in:
parent
e6f62f69f0
commit
1023dbbcb7
3 changed files with 31 additions and 2 deletions
|
@ -1158,8 +1158,8 @@ class Timer(Thread):
|
|||
self.function(*self.args, **self.kwargs)
|
||||
self.finished.set()
|
||||
|
||||
|
||||
# Special thread class to represent the main thread
|
||||
# This is garbage collected through an exit handler
|
||||
|
||||
class _MainThread(Thread):
|
||||
|
||||
|
@ -1272,7 +1272,6 @@ def _shutdown():
|
|||
while t:
|
||||
t.join()
|
||||
t = _pickSomeNonDaemonThread()
|
||||
_main_thread._delete()
|
||||
|
||||
def _pickSomeNonDaemonThread():
|
||||
for t in enumerate():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue