def _fetch_index_package_info(self, package_name, current_version):
try:<EOL><INDENT>package_canonical_name = package_name<EOL>if self.PYPI_API_TYPE == '<STR_LIT>':<EOL><INDENT>package_canonical_name = canonicalize_name(package_name)<EOL><DEDENT>response = requests.get(self.PYPI_API_URL.format(package=package_canonical_name), timeout=<NUM_LIT:15>)<EOL><DEDENT>except HTTPError as e:  <EOL><INDENT>return False, e.message<EOL><DEDENT>if not response.ok:  <EOL><INDENT>return False, '<STR_LIT>'.format(response.reason)<EOL><DEDENT>if self.PYPI_API_TYPE == '<STR_LIT>':<EOL><INDENT>return self._parse_pypi_json_package_info(package_name, current_version, response)<EOL><DEDENT>elif self.PYPI_API_TYPE == '<STR_LIT>':<EOL><INDENT>return self._parse_simple_html_package_info(package_name, current_version, response)<EOL><DEDENT>else:  <EOL><INDENT>raise NotImplementedError('<STR_LIT>')<EOL><DEDENT>
:type package_name: str
:type current_version: version.Version