Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dropped python 2.7 compat code #6278

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion rest_framework/authentication.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""
Provides various authentication policies.
"""
from __future__ import unicode_literals

import base64
import binascii
Expand Down
3 changes: 0 additions & 3 deletions rest_framework/authtoken/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models

Expand Down
2 changes: 0 additions & 2 deletions rest_framework/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
versions of Django/Python, and compatibility wrappers around optional packages.
"""

from __future__ import unicode_literals

from django.conf import settings
from django.core import validators
from django.utils import six
Expand Down
1 change: 0 additions & 1 deletion rest_framework/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
based views, as well as the `@detail_route` and `@list_route` decorators, which are
used to annotate methods on viewsets that should be included by routers.
"""
from __future__ import unicode_literals

import types
import warnings
Expand Down
1 change: 0 additions & 1 deletion rest_framework/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
In addition Django's built in 403 and 404 exceptions are handled.
(`django.http.Http404` and `django.core.exceptions.PermissionDenied`)
"""
from __future__ import unicode_literals

import math

Expand Down
2 changes: 0 additions & 2 deletions rest_framework/fields.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import unicode_literals

import collections
import copy
import datetime
Expand Down
1 change: 0 additions & 1 deletion rest_framework/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Provides generic filtering backends that can be used to filter the results
returned by list views.
"""
from __future__ import unicode_literals

import operator
import warnings
Expand Down
1 change: 0 additions & 1 deletion rest_framework/generics.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""
Generic views that provide commonly needed behaviour.
"""
from __future__ import unicode_literals

from django.core.exceptions import ValidationError
from django.db.models.query import QuerySet
Expand Down
1 change: 0 additions & 1 deletion rest_framework/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
Future implementations might use JSON schema or other definitions in order
to return this information in a more standardized way.
"""
from __future__ import unicode_literals

from collections import OrderedDict

Expand Down
1 change: 0 additions & 1 deletion rest_framework/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
We don't bind behaviour to http method handlers yet,
which allows mixin classes to be composed in interesting ways.
"""
from __future__ import unicode_literals

from rest_framework import status
from rest_framework.response import Response
Expand Down
1 change: 0 additions & 1 deletion rest_framework/negotiation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Content negotiation deals with selecting an appropriate renderer given the
incoming request. Typically this will be based on the request's Accept header.
"""
from __future__ import unicode_literals

from django.http import Http404

Expand Down
1 change: 0 additions & 1 deletion rest_framework/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
Pagination serializers determine the structure of the output that should
be used for paginated responses.
"""
from __future__ import unicode_literals

from base64 import b64decode, b64encode
from collections import OrderedDict, namedtuple
Expand Down
1 change: 0 additions & 1 deletion rest_framework/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
They give us a generic way of being able to handle various media types
on the request, such as form content or json encoded data.
"""
from __future__ import unicode_literals

import codecs

Expand Down
1 change: 0 additions & 1 deletion rest_framework/permissions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""
Provides a set of pluggable permission policies.
"""
from __future__ import unicode_literals

from django.http import Http404
from django.utils import six
Expand Down
3 changes: 0 additions & 3 deletions rest_framework/relations.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# coding: utf-8
from __future__ import unicode_literals

import sys
from collections import OrderedDict

Expand Down
1 change: 0 additions & 1 deletion rest_framework/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

REST framework also provides an HTML renderer that renders the browsable API.
"""
from __future__ import unicode_literals

import base64
from collections import OrderedDict
Expand Down
1 change: 0 additions & 1 deletion rest_framework/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
- full support of PUT method, including support for file uploads
- form overloading of HTTP method, content type and content
"""
from __future__ import unicode_literals

import io
import sys
Expand Down
1 change: 0 additions & 1 deletion rest_framework/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

The appropriate renderer is called during Django's template response rendering.
"""
from __future__ import unicode_literals

from django.template.response import SimpleTemplateResponse
from django.utils import six
Expand Down
1 change: 0 additions & 1 deletion rest_framework/reverse.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""
Provide urlresolver functions that return fully qualified URLs or view names
"""
from __future__ import unicode_literals

from django.urls import NoReverseMatch
from django.urls import reverse as django_reverse
Expand Down
1 change: 0 additions & 1 deletion rest_framework/routers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

urlpatterns = router.urls
"""
from __future__ import unicode_literals

import itertools
import warnings
Expand Down
1 change: 0 additions & 1 deletion rest_framework/schemas/inspectors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
inspectors.py # Per-endpoint view introspection

Expand Down
1 change: 0 additions & 1 deletion rest_framework/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
2. The process of marshalling between python primitives and request and
response content is handled by parsers and renderers.
"""
from __future__ import unicode_literals

import copy
import inspect
Expand Down
1 change: 0 additions & 1 deletion rest_framework/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
REST framework settings, checking for user settings first, then falling
back to the defaults.
"""
from __future__ import unicode_literals

from importlib import import_module

Expand Down
1 change: 0 additions & 1 deletion rest_framework/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
And RFC 6585 - https://tools.ietf.org/html/rfc6585
And RFC 4918 - https://tools.ietf.org/html/rfc4918
"""
from __future__ import unicode_literals


def is_informational(code):
Expand Down
2 changes: 0 additions & 2 deletions rest_framework/templatetags/rest_framework.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals

import re
from collections import OrderedDict

Expand Down
4 changes: 1 addition & 3 deletions rest_framework/test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# -- coding: utf-8 --

# Note that we import as `DjangoRequestFactory` and `DjangoClient` in order
# to make it harder for the user to import the wrong thing without realizing.
from __future__ import unicode_literals


import io
from importlib import import_module
Expand Down
1 change: 0 additions & 1 deletion rest_framework/throttling.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""
Provides various throttling policies.
"""
from __future__ import unicode_literals

import time

Expand Down
2 changes: 0 additions & 2 deletions rest_framework/urlpatterns.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import unicode_literals

from django.conf.urls import include, url

from rest_framework.compat import (
Expand Down
1 change: 0 additions & 1 deletion rest_framework/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

You should make sure your authentication settings include `SessionAuthentication`.
"""
from __future__ import unicode_literals

from django.conf.urls import url
from django.contrib.auth import views
Expand Down
2 changes: 0 additions & 2 deletions rest_framework/utils/breadcrumbs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import unicode_literals

from django.urls import get_script_prefix, resolve


Expand Down
2 changes: 0 additions & 2 deletions rest_framework/utils/encoders.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"""
Helper classes for parsers.
"""
from __future__ import absolute_import, unicode_literals

import datetime
import decimal
import json # noqa
Expand Down
1 change: 0 additions & 1 deletion rest_framework/utils/formatting.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""
Utility functions to return a formatted name and description for a given view.
"""
from __future__ import unicode_literals

import re

Expand Down
2 changes: 0 additions & 2 deletions rest_framework/utils/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
handled by users at the renderer and parser layer.
"""

from __future__ import absolute_import

import functools
import json # noqa

Expand Down
1 change: 0 additions & 1 deletion rest_framework/utils/mediatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

See https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7
"""
from __future__ import unicode_literals

from django.http.multipartparser import parse_header
from django.utils.encoding import python_2_unicode_compatible
Expand Down
1 change: 0 additions & 1 deletion rest_framework/utils/representation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Helper functions for creating user-friendly representations
of serializer classes and serializer fields.
"""
from __future__ import unicode_literals

import re

Expand Down
2 changes: 0 additions & 2 deletions rest_framework/utils/serializer_helpers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import unicode_literals

import collections
from collections import OrderedDict

Expand Down
1 change: 0 additions & 1 deletion rest_framework/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
object creation, and makes it possible to switch between using the implicit
`ModelSerializer` class and an equivalent explicit `Serializer` class.
"""
from __future__ import unicode_literals

from django.db import DataError
from django.utils.translation import ugettext_lazy as _
Expand Down
3 changes: 0 additions & 3 deletions rest_framework/versioning.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# coding: utf-8
from __future__ import unicode_literals

import re

from django.utils.translation import ugettext_lazy as _
Expand Down
1 change: 0 additions & 1 deletion rest_framework/views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""
Provides an APIView class that is the base of all views in REST framework.
"""
from __future__ import unicode_literals

from django.conf import settings
from django.core.exceptions import PermissionDenied
Expand Down
1 change: 0 additions & 1 deletion rest_framework/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
router.register(r'users', UserViewSet, 'user')
urlpatterns = router.urls
"""
from __future__ import unicode_literals

from collections import OrderedDict
from functools import update_wrapper
Expand Down