def _fetch_access_token(self, url, params):
logger.info('<STR_LIT>')<EOL>res = self._http.get(<EOL>url=url,<EOL>params=params<EOL>)<EOL>try:<EOL><INDENT>res.raise_for_status()<EOL><DEDENT>except requests.RequestException as reqe:<EOL><INDENT>raise WeChatClientException(<EOL>errcode=None,<EOL>errmsg=None,<EOL>client=self,<EOL>request=reqe.request,<EOL>response=reqe.response<EOL>)<EOL><DEDENT>result = res.json()<EOL>if '<STR_LIT>' in result and result['<STR_LIT>'] != <NUM_LIT:0>:<EOL><INDENT>raise WeChatClientException(<EOL>result['<STR_LIT>'],<EOL>result['<STR_LIT>'],<EOL>client=self,<EOL>request=res.request,<EOL>response=res<EOL>)<EOL><DEDENT>expires_in = <NUM_LIT><EOL>if '<STR_LIT>' in result:<EOL><INDENT>expires_in = result['<STR_LIT>']<EOL><DEDENT>self.session.set(<EOL>self.access_token_key,<EOL>result['<STR_LIT>'],<EOL>expires_in<EOL>)<EOL>self.expires_at = int(time.time()) + expires_in<EOL>return result<EOL>
The real fetch access token