mirror of
				https://github.com/encode/django-rest-framework.git
				synced 2025-11-04 09:57:55 +03:00 
			
		
		
		
	compat: (py2) urlparse = urllib.parse (py3) (#6262)
* compat: (py2) urlparse = urllib.parse (py3) We were mistakenly importing the 'urlparse' function from the Python 2 'urlparse' module, as opposed to the module itself. Correct this. Signed-off-by: Stephen Finucane <stephen@that.guru> Closes: #6261 * compat: Remove 'compat.urlparse' We can just use Django's vendored six library, like we do everywhere else. Signed-off-by: Stephen Finucane <stephen@that.guru>
This commit is contained in:
		
							parent
							
								
									a49d744d5e
								
							
						
					
					
						commit
						c052a86c7b
					
				| 
						 | 
				
			
			@ -17,13 +17,6 @@ except ImportError:
 | 
			
		|||
    # Python 2.7
 | 
			
		||||
    from collections import Mapping   # noqa
 | 
			
		||||
 | 
			
		||||
try:
 | 
			
		||||
    # Python 3
 | 
			
		||||
    import urllib.parse as urlparse   # noqa
 | 
			
		||||
except ImportError:
 | 
			
		||||
    # Python 2.7
 | 
			
		||||
    from urlparse import urlparse   # noqa
 | 
			
		||||
 | 
			
		||||
try:
 | 
			
		||||
    from django.urls import (  # noqa
 | 
			
		||||
        URLPattern,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -21,11 +21,12 @@ from django.test.client import encode_multipart
 | 
			
		|||
from django.urls import NoReverseMatch
 | 
			
		||||
from django.utils import six
 | 
			
		||||
from django.utils.html import mark_safe
 | 
			
		||||
from django.utils.six.moves.urllib import parse as urlparse
 | 
			
		||||
 | 
			
		||||
from rest_framework import VERSION, exceptions, serializers, status
 | 
			
		||||
from rest_framework.compat import (
 | 
			
		||||
    INDENT_SEPARATORS, LONG_SEPARATORS, SHORT_SEPARATORS, coreapi, coreschema,
 | 
			
		||||
    pygments_css, urlparse, yaml
 | 
			
		||||
    pygments_css, yaml
 | 
			
		||||
)
 | 
			
		||||
from rest_framework.exceptions import ParseError
 | 
			
		||||
from rest_framework.request import is_form_media_type, override_method
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user