Skip to content

Commit

Permalink
Remove leftover Python2 compatibility hybridation.
Browse files Browse the repository at this point in the history
Compatibility has already been dropped anyway in 2.2.0.
  • Loading branch information
a-detiste authored Oct 23, 2024
1 parent 70b389d commit f287c09
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 14 deletions.
3 changes: 1 addition & 2 deletions bitfield/admin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import django
import six

from django.core.exceptions import ValidationError
if django.VERSION < (2, 0):
Expand Down Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions bitfield/models.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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))
Expand Down
7 changes: 1 addition & 6 deletions bitfield/types.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
from __future__ import absolute_import

from six import string_types


def cmp(a, b):
return (a > b) - (a < b)

Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def visit_Assign(self, node):
zip_safe=False,
install_requires=[
'Django>=1.11.29',
'six',
],
extras_require={
'tests': [
Expand Down

0 comments on commit f287c09

Please sign in to comment.