title: Python Exception in thread Thread-1 (most likely raised during interpreter shutdown)?
body: <p>My friend and I have been working on a large project to learn and for fun in python and PyGame. Basically it is an AI simulation of a small village. we wanted a day/night cycle so I found a neat way to change the color of an entire surface using numpy (specifically the cross-fade tutorial) - <a href="http://www.pygame.org/docs/tut/surfarray/SurfarrayIntro.html" rel="noreferrer">http://www.pygame.org/docs/tut/surfarray/SurfarrayIntro.html</a> </p>
  
  <p>I implemented it into the code and it WORKS, but is extremely slow, like &lt; 1 fps slow. so I look into threading (because I wanted to add it eventually) and found this page on Queues - <a href="https://stackoverflow.com/questions/14585597/learning-about-queue-module-in-python-how-to-run-it">Learning about Queue module in python (how to run it)</a></p>
  
  <p>I spend about 15 minutes making a basic system but as soon as I run it, the window closes and it says</p>
  
  <pre><code>Exception in thread Thread-1 (most likely raised during interpreter shutdown):
  </code></pre>
  
  <p>EDIT: This is literally all it says, no Traceback error</p>
  
  <p>I don't know what I am doing wrong, but I assume I am missing something simple. I added the necessary parts of the code below.</p>
  
  <pre><code>q_in = Queue.Queue(maxsize=0)
  
  q_out = Queue.Queue(maxsize=0)
  
  def run():    #Here is where the main stuff happens
      #There is more here I am just showing the essential parts
      while True:
          a = abs(abs(world.degree-180)-180)/400.
  
          #Process world
          world.process(time_passed_seconds)
  
          blank_surface = pygame.Surface(SCREEN_SIZE)
          world.render(blank_surface)    #The world class renders everything onto a blank surface
          q_in.put((blank_surface, a))
          screen.blit(q_out.get(), (0,0))
  
  def DayNight():
      while True:
          blank_surface, a = q_in.get()
          imgarray = surfarray.array3d(blank_surface)  # Here is where the new numpy       stuff starts (AKA Day/Night cycle)
          src = N.array(imgarray)
          dest = N.zeros(imgarray.shape)
          dest[:] = 20, 30, 120
          diff = (dest - src) * a
          xfade = src + diff.astype(N.int)
  
          surfarray.blit_array(blank_surface, xfade)
          q_out.put(blank_surface)
          q_in.task_done()
  
  def main():
      MainT = threading.Thread(target=run)
      MainT.daemon = True
      MainT.start()
  
      DN = threading.Thread(target=DayNight)
      DN.daemon = True
      DN.start()
  
      q_in.join()
      q_out.join()
  </code></pre>
  
  <p>If anyone could help it would be greatly appreciated. Thank you.</p>