Added correct exception handling for .curaprofile importing

CURA-2252
This commit is contained in:
Jaime van Kessel 2016-09-02 10:16:11 +02:00
parent 6c6ced4048
commit d7d1804319

View file

@ -26,7 +26,11 @@ class CuraProfileReader(ProfileReader):
# not be read or didn't contain a valid profile, \code None \endcode is
# returned.
def read(self, file_name):
try:
archive = zipfile.ZipFile(file_name, "r")
except Exception:
# zipfile doesn't give proper exceptions, so we can only catch broad ones
return []
results = []
for profile_id in archive.namelist():
# Create an empty profile.