diff --git a/django/contrib/gis/db/models/functions.py b/django/contrib/gis/db/models/functions.py index 93a5031bd5..85f704c1ef 100644 --- a/django/contrib/gis/db/models/functions.py +++ b/django/contrib/gis/db/models/functions.py @@ -101,7 +101,7 @@ class GeomOutputGeoFunc(GeoFunc): def __init__(self, *expressions, **extra): if 'output_field' not in extra: extra['output_field'] = GeometryField() - super(GeomOutputGeoFunc, self).__init__(*expressions, **extra) + super().__init__(*expressions, **extra) def resolve_expression(self, *args, **kwargs): res = super().resolve_expression(*args, **kwargs) diff --git a/django/forms/models.py b/django/forms/models.py index 3b5e1300e0..f4467d2ebb 100644 --- a/django/forms/models.py +++ b/django/forms/models.py @@ -1301,7 +1301,8 @@ class ModelMultipleChoiceField(ModelChoiceField): if (hasattr(value, '__iter__') and not isinstance(value, str) and not hasattr(value, '_meta')): - return [super(ModelMultipleChoiceField, self).prepare_value(v) for v in value] + prepare_value = super().prepare_value + return [prepare_value(v) for v in value] return super().prepare_value(value) def has_changed(self, initial, data): diff --git a/tests/model_forms/tests.py b/tests/model_forms/tests.py index e636d212d8..96f6d6985b 100644 --- a/tests/model_forms/tests.py +++ b/tests/model_forms/tests.py @@ -1666,7 +1666,7 @@ class ModelChoiceFieldTests(TestCase): category = forms.ModelChoiceField(queryset=None) def __init__(self, *args, **kwargs): - super(ModelChoiceForm, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self.fields['category'].queryset = Category.objects.filter(slug__contains='test') form = ModelChoiceForm()