nidhal baccouri commited on
Commit
af08fe3
·
1 Parent(s): f7189fa

converted default dict get to None

Browse files
Files changed (1) hide show
  1. deep_translator/qcri.py +1 -1
deep_translator/qcri.py CHANGED
@@ -74,7 +74,7 @@ class QCRI(object):
74
  ServerException(response.status_code)
75
  else:
76
  res = response.json()
77
- translation = res["translatedText"]
78
  if not translation:
79
  raise TranslationNotFound(text)
80
  return translation
 
74
  ServerException(response.status_code)
75
  else:
76
  res = response.json()
77
+ translation = res.get("translatedText")
78
  if not translation:
79
  raise TranslationNotFound(text)
80
  return translation