diff --git a/bitfield/admin.py b/bitfield/admin.py index 8d790e3..2199fb9 100644 --- a/bitfield/admin.py +++ b/bitfield/admin.py @@ -1,5 +1,4 @@ import django -import six from django.core.exceptions import ValidationError if django.VERSION < (2, 0): @@ -29,7 +28,7 @@ def __init__(self, field, request, params, model, model_admin, field_path): def queryset(self, request, queryset): filter_kwargs = dict( (p, BitHandler(v, ())) - for p, v in six.iteritems(self.used_parameters) + for p, v in self.used_parameters.items() ) if not filter_kwargs: return queryset diff --git a/bitfield/models.py b/bitfield/models.py index 5fe3e78..e1596fd 100644 --- a/bitfield/models.py +++ b/bitfield/models.py @@ -1,7 +1,3 @@ -from __future__ import absolute_import - -import six - from django.db.models import signals from django.db.models.fields import Field, BigIntegerField @@ -154,7 +150,7 @@ def to_python(self, value): # Regression for #1425: fix bad data that was created resulting # in negative values for flags. Compute the value that would # have been visible ot the application to preserve compatibility. - if isinstance(value, six.integer_types) and value < 0: + if isinstance(value, int) and value < 0: new_value = 0 for bit_number, _ in enumerate(self.flags): new_value |= (value & (2 ** bit_number)) diff --git a/bitfield/types.py b/bitfield/types.py index d7f6d8f..b6c10a6 100644 --- a/bitfield/types.py +++ b/bitfield/types.py @@ -1,8 +1,3 @@ -from __future__ import absolute_import - -from six import string_types - - def cmp(a, b): return (a > b) - (a < b) @@ -238,7 +233,7 @@ def iteritems(self): yield (k, getattr(self, k).is_set) def get_label(self, flag): - if isinstance(flag, string_types): + if isinstance(flag, str): flag = self._keys.index(flag) if isinstance(flag, Bit): flag = flag.number diff --git a/setup.py b/setup.py index dd9a96e..af20766 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,6 @@ def visit_Assign(self, node): zip_safe=False, install_requires=[ 'Django>=1.11.29', - 'six', ], extras_require={ 'tests': [