code: def test_detach_from_self(self):
      errors = []
      handles = []
      start_joinable_thread_returned = thread.allocate_lock()
      start_joinable_thread_returned.acquire()
      thread_detached = thread.allocate_lock()
      thread_detached.acquire()
  
      def task():
          start_joinable_thread_returned.acquire()
          try:
              handles[0].detach()
          except Exception as e:
              errors.append(e)
          finally:
              thread_detached.release()
  
      with threading_helper.wait_threads_exit():
          handle = thread.start_joinable_thread(task)
          handles.append(handle)
          start_joinable_thread_returned.release()
          thread_detached.acquire()
          with self.assertRaisesRegex(ValueError, "not joinable"):
              handle.join()
  
      assert len(errors) == 0
  
imports: import os
  import unittest
  import random
  from test import support
  from test.support import threading_helper
  import _thread
  import time
  import warnings
  import weakref
  from test import lock_tests
label_desc: Use image node_id 13 for calling the ThreadRunningTests obj's underlying member method code with example usage: obj.test_detach_from_self() without return types