django 3.2: get rid of six.text_type (#64430)

This commit is contained in:
Emmanuel Cazenave 2022-06-09 17:29:03 +02:00
parent 112c55fac4
commit dc9e7a0d42
3 changed files with 3 additions and 6 deletions

View File

@ -8,7 +8,6 @@ import sys
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth import models as auth_models
from django.utils.encoding import force_text
from django.utils import six
from ... import models
@ -30,7 +29,7 @@ def unicode_csv_reader(utf8_csv_data, dialect=csv.excel, **kwargs):
def csv_to_list(s):
return filter(None, map(six.text_type.strip, s.split(u',')))
return filter(None, map(str.strip, s.split(u',')))
# Utilise seulement des majuscules et des chiffres, sauf i,l et 1, O et 0

View File

@ -27,7 +27,6 @@ except ImportError:
ET = None
from django.utils import six
from django.utils.encoding import force_text
@ -112,7 +111,7 @@ class WorkSheet(object):
class WorkCell(object):
def __init__(self, worksheet, value, hint=None):
if type(value) is not six.text_type:
if type(value) is not str:
value = force_text(value, 'utf-8')
self.value = value
self.worksheet = worksheet

View File

@ -28,7 +28,6 @@ from django.views.decorators.debug import sensitive_post_parameters
from django.views.decorators.cache import never_cache
from django.views.decorators.http import require_http_methods
from django.utils.encoding import force_text
from django.utils import six
try:
from BeautifulSoup import BeautifulSoup
@ -868,7 +867,7 @@ class DeleteDocumentsView(object):
documents = self.get_queryset()
else:
selection = selection.split(',')
if all(map(six.text_type.isdigit, selection)):
if all(map(str.isdigit, selection)):
selection = map(int, selection)
documents = self.get_queryset().filter(id__in=selection)
if documents: