mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #27818 -- Replaced try/except/pass with contextlib.suppress().
This commit is contained in:
parent
43a4835edf
commit
550cb3a365
67 changed files with 223 additions and 368 deletions
|
@ -1,4 +1,5 @@
|
|||
import os
|
||||
from contextlib import suppress
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from django.conf import settings
|
||||
|
@ -48,10 +49,8 @@ class PathNotImplementedStorage(storage.Storage):
|
|||
|
||||
def delete(self, name):
|
||||
name = self._path(name)
|
||||
try:
|
||||
with suppress(FileNotFoundError):
|
||||
os.remove(name)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
def path(self, name):
|
||||
raise NotImplementedError
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue