mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +03:00
Merge pull request #5579 from jdufresne/urllib
Remove ulrparse compatability shim; use six instead
This commit is contained in:
commit
9234ac576e
|
@ -54,12 +54,6 @@ def make_url_resolver(regex, urlpatterns):
|
||||||
return RegexURLResolver(regex, urlpatterns)
|
return RegexURLResolver(regex, urlpatterns)
|
||||||
|
|
||||||
|
|
||||||
try:
|
|
||||||
import urlparse # Python 2.x
|
|
||||||
except ImportError:
|
|
||||||
import urllib.parse as urlparse
|
|
||||||
|
|
||||||
|
|
||||||
def unicode_repr(instance):
|
def unicode_repr(instance):
|
||||||
# Get the repr of an instance, but ensure it is a unicode string
|
# Get the repr of an instance, but ensure it is a unicode string
|
||||||
# on both python 3 (already the case) and 2 (not the case).
|
# on both python 3 (already the case) and 2 (not the case).
|
||||||
|
|
|
@ -9,10 +9,11 @@ from collections import OrderedDict
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils.encoding import force_text, smart_text
|
from django.utils.encoding import force_text, smart_text
|
||||||
|
from django.utils.six.moves.urllib import parse as urlparse
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from rest_framework import exceptions, serializers
|
from rest_framework import exceptions, serializers
|
||||||
from rest_framework.compat import coreapi, coreschema, uritemplate, urlparse
|
from rest_framework.compat import coreapi, coreschema, uritemplate
|
||||||
from rest_framework.settings import api_settings
|
from rest_framework.settings import api_settings
|
||||||
from rest_framework.utils import formatting
|
from rest_framework.utils import formatting
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user