Skip to content

Commit

Permalink
Remove six
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Aug 27, 2021
1 parent cc34677 commit 5f2fc23
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 10 deletions.
2 changes: 0 additions & 2 deletions advanced_filters/form_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

from django import forms

import six

logger = logging.getLogger('advanced_filters.form_helpers')

extra_spaces_pattern = re.compile(r'\s+')
Expand Down
2 changes: 1 addition & 1 deletion advanced_filters/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from django.db.models.fields import DateField
from django.forms.formsets import formset_factory, BaseFormSet
from django.utils.functional import cached_property
from six.moves import reduce
from functools import reduce
from django.utils.text import capfirst
from django.utils.translation import gettext_lazy as _

Expand Down
5 changes: 0 additions & 5 deletions advanced_filters/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
from django.utils.encoding import force_text as force_string
from django.views.decorators.csrf import csrf_exempt

try:
from django.utils import six
except ImportError:
import six


class CsrfExemptMixin:
"""
Expand Down
3 changes: 1 addition & 2 deletions advanced_filters/q_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import base64
import time

import six
from django.db.models import Q
from django.core.serializers.base import SerializationError

Expand Down Expand Up @@ -121,7 +120,7 @@ def dumps(self, obj):
raise SerializationError
string = json.dumps(self.serialize(obj), default=dt2ts)
if self.b64_enabled:
return base64.b64encode(six.b(string)).decode("utf-8")
return base64.b64encode(string.encode("latin-1")).decode("utf-8")
return string

def loads(self, string, raw=False):
Expand Down

0 comments on commit 5f2fc23

Please sign in to comment.