Simplify error handling in Document.get_file_size()

SystemExit and KeyboardInterrupt are not inherited from Exception, so they don't need special treatment here.
This commit is contained in:
Sergey Fedoseev 2018-10-26 13:54:57 +05:00 committed by Matt Westcott
parent 3bb6984132
commit 51ea37a403

View file

@ -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