title: Mypy throws and error 'Missing return statement', but i can't see where I'm missing it
body: <p>I'm trying to implement a retry function in http_requests, but I'm running into problems with a 'needed' return statement, although I cant figure out where this should be </p>
  
  <pre><code>def _http_request(method: _HttpMethod, url: str, **kwargs) -&gt; Optional[requests.models.Response]:
      _body: Any = None
      _retries: Any = 3
      if "json" in kwargs:
          _body = kwargs.get("json")
      elif "data" in kwargs:
          _body = kwargs.get("data")
      elif "retries" in kwargs:
          _retries = kwargs.get("retries")
      elif "timeout" in kwargs:
          _timeout = kwargs.get("timeout")
  
      for _retry in range(1, _retries):
          try:
              logging.debug(f"{method.value} {url} body: {_body}")
              _response = requests.request(method.value, url, **kwargs)
              logging.debug(f"{_response.status_code} body: {_response.text}")
              return _response
          except NewConnectionError:
              logging.error("Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time.")
              return None
          except requests.exceptions.ConnectionError:
              logging.error("Failed to establish a new connection: [Errno 113] No route to host.")
              return None
          except requests.exceptions.Timeout:
              if _retry &lt;= 3:
                  logging.warning(f"Connection to Jira timed out after {_timeout}, trying to connect again({_retry} of {_retries} retries)")
              else:
                  logging.error(f"Failed to connect to jira server efter {_retries}")
                  return None
  </code></pre>