Skip to content

Commit

Permalink
Merge pull request #196 from alandtse/dependencies
Browse files Browse the repository at this point in the history
fix: fix syntax errors due to httpx
  • Loading branch information
alandtse committed May 1, 2021
2 parents 11ef0fb + cea4135 commit a34da72
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions teslajsonpy/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ async def get_authorization_code(
return
url = self.get_authorization_code_link(new=True)
resp = await self.websession.get(str(url.update_query({"login_hint": email})))
html = await resp.text()
html = resp.text
if resp.history:
for item in resp.history:
if (
Expand All @@ -427,7 +427,7 @@ async def get_authorization_code(
resp = await self.websession.post(str(url), data=data)
_process_resp(resp)
if not resp.history:
html = await resp.text()
html = resp.text
if "/mfa/verify" in html:
_LOGGER.debug("Detected MFA request")
mfa_resp = await self.websession.get(
Expand Down Expand Up @@ -600,11 +600,11 @@ def _process_resp(resp) -> Text:
if resp.history:
for item in resp.history:
_LOGGER.debug("%s: redirected from\n%s", item.method, item.url)
url = str(resp.request_info.url)
method = resp.request_info.method
url = str(resp.request.url)
method = resp.request.method
status = resp.status_code
reason = resp.reason
headers = resp.request_info.headers
reason = resp.reason_phrase
headers = resp.request.headers
_LOGGER.debug(
"%s: \n%s with\n%s\n returned %s:%s with response %s",
method,
Expand Down

0 comments on commit a34da72

Please sign in to comment.