Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime van Kessel <nallath@gmail.com>2016-09-02 11:16:11 +0300
committerJaime van Kessel <nallath@gmail.com>2016-09-02 11:16:11 +0300
commitd7d18043196734ae98da57ea24033b34cd485765 (patch)
treec4168abe2eccf20c603f97beddd26d4ddd5c3484 /plugins/CuraProfileReader
parent6c6ced404867806510d760514a0b9744a0c0a956 (diff)
Added correct exception handling for .curaprofile importing
CURA-2252
Diffstat (limited to 'plugins/CuraProfileReader')
-rw-r--r--plugins/CuraProfileReader/CuraProfileReader.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/CuraProfileReader/CuraProfileReader.py b/plugins/CuraProfileReader/CuraProfileReader.py
index 8007a8e696..772b11890b 100644
--- a/plugins/CuraProfileReader/CuraProfileReader.py
+++ b/plugins/CuraProfileReader/CuraProfileReader.py
@@ -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):
- archive = zipfile.ZipFile(file_name, "r")
+ 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.