Commit 63bd92ec953a4eca12512e673f7da4259ce62bfc
1 parent
fe3ba85b
Exists in
devel
Adiciona captura de exceção no PortGlosa
Showing
1 changed file
with
6 additions
and
3 deletions
Show diff stats
src/PortGlosa.py
... | ... | @@ -12,9 +12,12 @@ from LerDicionarios import * |
12 | 12 | |
13 | 13 | taxas = [] |
14 | 14 | dicionario = LerDicionarios() |
15 | -classe_pai = inspect.getframeinfo(inspect.getouterframes(inspect.currentframe())[1][0])[0] | |
16 | -if classe_pai == "TranslationServer.py": | |
17 | - dicionario.carregar_dicionarios() | |
15 | +try: | |
16 | + classe_pai = inspect.getframeinfo(inspect.getouterframes(inspect.currentframe())[1][0])[0] | |
17 | + if classe_pai == "TranslationServer.py": | |
18 | + dicionario.carregar_dicionarios() | |
19 | +except: | |
20 | + pass | |
18 | 21 | |
19 | 22 | def traduzir(texto, threads=False, taxa_qualidade=False): |
20 | 23 | if texto.isspace() or texto == "": | ... | ... |