title: Getting a 'type error-cannot unpack' on every second try
body: <p>Using pyautogui, I'm creating a simple program to log me into a VPN. First part of the code works fine each time, (double clicking an icon on desktop), the second part, left clicking on the connect button, works every other try. When it doesn't work I'm getting <code>TypeError: cannot unpack non-iterable NoneType object</code>.</p>
  <p>However, this only occurs every second try. Every other try it works just fine. I ran it 50 times, and exactly every other try it works/doesn't work.</p>
  <pre><code>import pyautogui as pg
  import time
  
  
  def rpats_update():
      time.sleep(1.5)
      pg.doubleClick(cisco)
      time.sleep(0.2)
      attempts = 0
      while attempts &lt; 3:
          try:
              pg.leftClick(connect)
          except TypeError:
              attempts += 1
  
  
  
  rpats_update()
  </code></pre>