Skip to content

Commit

Permalink
- under Python 2 that ValueError is not thrown. Sigh.
Browse files Browse the repository at this point in the history
  • Loading branch information
dataflake committed Feb 13, 2019
1 parent 0004e46 commit 9189525
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/OFS/Image.py
Expand Up @@ -553,14 +553,14 @@ def manage_upload(self, file='', REQUEST=None):
if self.wl_isLocked():
raise ResourceLockedError("File is locked.")

try:
if file:
data, size = self._read_data(file)
content_type = self._get_content_type(file, data, self.__name__,
'application/octet-stream')
self.update_data(data, content_type, size)
notify(ObjectModifiedEvent(self))
msg = 'Saved changes.'
except ValueError:
else:
msg = 'Please select a file to upload.'

if REQUEST:
Expand Down

0 comments on commit 9189525

Please sign in to comment.