Commit d849955d authored by Michal Čihař's avatar Michal Čihař

Gracefully handle another error string

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 6ecd2428
......@@ -107,8 +107,8 @@ class MachineTranslation(object):
'\r', '\\r'
)
# Needed for Google
while ',,' in text:
text = text.replace(',,', ',null,')
while ',,' in text or '[,' in text:
text = text.replace(',,', ',null,').replace('[,','[')
# Parse JSON
response = json.loads(text)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment