Skip to content

Commit

Permalink
Nuevo try/catch para errores de descompresión
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephTico authored Jan 6, 2021
1 parent 5d8d149 commit 182781b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,13 @@ def cli_login():
if total_size_in_bytes != 0 and progress_bar.n != total_size_in_bytes:
raise Exception('Error al descargar el archivo.')

with zipfile.ZipFile(filename,"r") as zip_ref:
zip_ref.extractall(os.path.join(dirname, semestre["titulo"]))
try:
with zipfile.ZipFile(filename,"r") as zip_ref:
zip_ref.extractall(os.path.join(dirname, semestre["titulo"]))
except:
print("Ha ocurrido un error al descomprimir los contenidos de este curso. Se mantendrá el archivo comprimido")
else:
os.remove(filename)

os.remove(filename)

Expand Down

0 comments on commit 182781b

Please sign in to comment.