Update compatibility for Django 4.0

The only meaningful change is removing use of `force_text` (which was
deprecated in Django 3.0) in favor of `force_str` (which has existed
since before Django 1.11). On Python 3 there is no functional difference
between the two.
This commit is contained in:
Peter Marheine 2021-12-09 11:10:01 +11:00
parent a64a0e8c33
commit 198f6a3295
2 changed files with 3 additions and 2 deletions

View file

@ -1,7 +1,7 @@
"""Low-level IO operations, for use with file wrappers."""
import io
from django.utils.encoding import force_bytes, force_text
from django.utils.encoding import force_bytes, force_str
class TextIteratorIO(io.TextIOBase):
@ -32,7 +32,7 @@ class TextIteratorIO(io.TextIOBase):
break
else:
# Make sure we handle text.
self._left = force_text(self._left)
self._left = force_str(self._left)
ret = self._left[:n]
self._left = self._left[len(ret) :]
return ret

View file

@ -23,6 +23,7 @@ setup(
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.1',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0',
],
keywords=" ".join(
[