refactor: pyupgrade second iteration (#27459)

This commit is contained in:
Usama Sadiq
2021-05-10 13:56:40 +05:00
committed by GitHub
parent 372c4abfa6
commit 64752ed66c
14 changed files with 37 additions and 37 deletions

View File

@@ -15,13 +15,13 @@ from storages.backends.s3boto3 import S3Boto3Storage
from openedx.core.djangoapps.theming.storage import ThemeManifestFilesMixin, ThemePipelineMixin, ThemeMixin
class PipelineForgivingMixin(object):
class PipelineForgivingMixin:
"""
An extension of the django-pipeline storage backend which forgives missing files.
"""
def hashed_name(self, name, content=None, **kwargs): # lint-amnesty, pylint: disable=missing-function-docstring
try:
out = super(PipelineForgivingMixin, self).hashed_name(name, content, **kwargs) # lint-amnesty, pylint: disable=super-with-arguments
out = super().hashed_name(name, content, **kwargs) # lint-amnesty, pylint: disable=super-with-arguments
except ValueError:
# This means that a file could not be found, and normally this would
# cause a fatal error, which seems rather excessive given that
@@ -31,7 +31,7 @@ class PipelineForgivingMixin(object):
def stored_name(self, name): # lint-amnesty, pylint: disable=missing-function-docstring
try:
out = super(PipelineForgivingMixin, self).stored_name(name) # lint-amnesty, pylint: disable=super-with-arguments
out = super().stored_name(name) # lint-amnesty, pylint: disable=super-with-arguments
except ValueError:
# This means that a file could not be found, and normally this would
# cause a fatal error, which seems rather excessive given that
@@ -54,7 +54,7 @@ class ProductionMixin(
"""
def __init__(self, *args, **kwargs):
kwargs.update(settings.STATICFILES_STORAGE_KWARGS.get(settings.STATICFILES_STORAGE, {}))
super(ProductionMixin, self).__init__(*args, **kwargs) # lint-amnesty, pylint: disable=super-with-arguments
super().__init__(*args, **kwargs) # lint-amnesty, pylint: disable=super-with-arguments
class ProductionStorage(ProductionMixin, StaticFilesStorage):