From f4aa28c2eb90cb7b83b633176a8f9dd5b87acd91 Mon Sep 17 00:00:00 2001 From: Suhun Han Date: Wed, 2 Dec 2020 22:10:02 +0900 Subject: [PATCH] refactor(gtoken): descriptive error message (#234) --- googletrans/gtoken.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/googletrans/gtoken.py b/googletrans/gtoken.py index 54a4f7f..987cd92 100644 --- a/googletrans/gtoken.py +++ b/googletrans/gtoken.py @@ -57,7 +57,7 @@ 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: @@ -65,7 +65,7 @@ def _update(self): 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