kopia lustrzana https://github.com/wagtail/wagtail
Simplify error handling in Document.get_file_size()
SystemExit and KeyboardInterrupt are not inherited from Exception, so they don't need special treatment here.pull/4852/head
rodzic
3bb6984132
commit
51ea37a403
|
@ -52,8 +52,6 @@ class AbstractDocument(CollectionMember, index.Indexed, models.Model):
|
|||
if self.file_size is None:
|
||||
try:
|
||||
self.file_size = self.file.size
|
||||
except (SystemExit, KeyboardInterrupt):
|
||||
raise
|
||||
except Exception:
|
||||
# File doesn't exist
|
||||
return
|
||||
|
|
Ładowanie…
Reference in New Issue