title: Python3: Try block won't stop looping after recursive function call via caught exception
body: <p>I have a function that is a CLI menu for another program I'm working on. Each time the user enters input, the <code>input()</code> function is run within a <code>try</code> block.</p>
  <p>If all try blocks succeed without catching any exceptions, there is no issue and the function behaves as expected; the function runs through, <code>return 1</code> is called and the function ends.</p>
  <p>However, when an exception is raised, the user is notified why and then the current function is called recursively. When this occurs and then the user runs through the function, <code>return 1</code> is once again called, but this time the function immediately returns to the first try block in the function that had raised the exception previously.</p>
  <p>The function in question:</p>
  <pre><code>def menu_userSetup():
      selection = 0; selected_key = 0
  
      if userSettings is None:
          userSettings = defaultSettings
  
      refresh_UI('\_ Test Setup _/', py3_version, bash_version, True)
      COLS = get_terminal_size().columns
  
      print('\n', 'Current Settings:'.center(COLS))
  
      z = 0
      for setting in userSettings:
          print('{}. {}: {}'.center(COLS - (COLS // 50)).format(z, setting, userSettings[setting]), end='\r')
          z += 1
  
      print('\n', 'Which setting would you like to set?'.center(COLS), end='')
      try: selection = int(input('{}'.format(' ' * (COLS // 2))))
      except KeyboardInterrupt: EXIT('Detected KeyboardInterrupt..')
      except:
          print('\n', 'Oops. That input is invalid!'.center(COLS))
          t.sleep(1.5)
          menu_userSetup()
  
      # the tuple function is used to return the key string according to its unordered index
      try: selected_key = tuple(userSettings.items())[selection][0]
      except KeyboardInterrupt: EXIT('Detected KeyboardInterrupt..')
      except:
          print('\n', 'That is not an available option!'.center(COLS))
          t.sleep(1.5)
          menu_userSetup()
  
      COLS = get_terminal_size().columns
      refresh_UI('\_ Test Setup _/', py3_version, bash_version, True)
      print('\n', 'Ok, {} selected!'.center(COLS - (COLS // 50)).format(selected_key))
      print('Type in your new setting:'.center(COLS))
      new_set = input('{}'.format(' ' * (COLS // 2)))
  
      if new_set.find('true') and new_set.find('t') != -1:
          new_set = True
      elif new_set.find('false') and new_set.find('f') != -1:
          new_set = False
  
      if new_set is not None or '':
          userSettings[selected_key] = new_set
          print('\n', '{} has been set to {}!'.center(COLS - (COLS // 50)).format(selected_key, new_set))
          t.sleep(1.5)
      else:
          print('\n', 'Oops. That input is invalid!'.center(COLS))
          t.sleep(1.5)
          menu_userSetup()
  
      refresh_UI('\_ Test Setup _/', py3_version, bash_version, True)
      COLS = get_terminal_size().columns
  
      print('\n', 'Current Settings:'.center(COLS))
  
      z = 0
      for setting in userSettings:
          print('{}. {}: {}'.center(COLS - (COLS // 50)).format(z, setting, userSettings[setting]), end='\r')
          z += 1
  
      r = input(&quot;Press enter to return to the main menu or 'r' to make another change!\n&quot;)
      if r == 'r':
          menu_userSetup()
  
      print('returning...'); t.sleep(2)
      return 1
  </code></pre>
  <p>Is it perhaps simply not possible to recursively call a function from an <code>except</code> block?
  If it's not, how can I achieve the same effect of catching errors leading to a recursive function call?</p>
  <p>Note: This solution does <em>not</em> need to be compatible with python 2.x, but any extra info as a bonus is welcome nonetheless!</p>