Skip to content

Commit

Permalink
Avoid blind except
Browse files Browse the repository at this point in the history
  • Loading branch information
hvelarde committed Apr 26, 2018
1 parent 23d1fe0 commit 6e60dfe
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/collective/cover/widgets/textlinessortable.py
Expand Up @@ -51,12 +51,10 @@ def thumbnail(self, item):
:type item: Content object
:returns: The <img> tag for the scale
"""
if not item:
return None
scales = item.restrictedTraverse('@@images')
try:
scales = item.restrictedTraverse('@@images')
return scales.scale('image', 'tile')
except: # FIXME: B901 blind except: statement
except AttributeError:
return None

def isExpired(self, item):
Expand Down

0 comments on commit 6e60dfe

Please sign in to comment.