Skip to content

Commit

Permalink
Specified which exception to catch for python-magic call failure
Browse files Browse the repository at this point in the history
  • Loading branch information
jrods committed Sep 30, 2016
1 parent 2928d79 commit 7daa604
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ckan/lib/uploader.py
Expand Up @@ -177,7 +177,7 @@ def upload(self, max_size=2):

try:
self.mimetype = magic.from_file(filepath, mime=True)
except:
except IOError:
# Not that important if call above fails
self.mimetype = None

Expand Down Expand Up @@ -284,7 +284,7 @@ def upload(self, id, max_size=10):

try:
self.mimetype = magic.from_file(filepath, mime=True)
except:
except IOError:
# Not that important if call above fails
self.mimetype = None

Expand Down

0 comments on commit 7daa604

Please sign in to comment.