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
Sergey Fedoseev 2018-10-26 13:54:57 +05:00 zatwierdzone przez Matt Westcott
rodzic 3bb6984132
commit 51ea37a403
1 zmienionych plików z 0 dodań i 2 usunięć

Wyświetl plik

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