Skip to content

Commit c7286d1

Browse files
committed
check ValueError when removing thread.
1 parent 68abb0d commit c7286d1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/socketserver.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,10 @@ def _remove_thread(self):
663663
if not thread.daemon:
664664
with self._threads_lock:
665665
if self._threads is not None:
666-
self._threads.remove(thread)
666+
try:
667+
self._threads.remove(thread)
668+
except ValueError:
669+
pass
667670

668671
def process_request(self, request, client_address):
669672
"""Start a new thread to process the request."""

0 commit comments

Comments
 (0)