Skip to content

Commit

Permalink
refactor(gtoken): descriptive error message (ssut#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssut authored and c-goosen committed Sep 19, 2024
1 parent 623d7ae commit f4aa28c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions googletrans/gtoken.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ def _update(self):
if raw_tkk:
self.tkk = raw_tkk.group(1)
return

code = self.RE_TKK.search(r.text)

if code is not None:
# this will be the same as python code after stripping out a reserved word 'var'
code = code.group(1).replace('var ', '')
# unescape special ascii characters such like a \x3d(=)
code = code.encode().decode('unicode-escape')

if code:
tree = ast.parse(code)
visit_return = False
Expand Down

0 comments on commit f4aa28c

Please sign in to comment.