  from rest_framework.views import APIView
  
  factory = APIRequestFactory()
  
  if sys.version_info[:2] >= (3, 4):
      JSON_ERROR = 'JSON parse error - Expecting value:'
  else:
      JSON_ERROR = 'JSON parse error - No JSON object could be decoded'
  
  
  class BasicView(APIView):
      def get(self, request, *args, **kwargs):
          return Response({'method': 'GET'})
 
</s> remove             raise ParseError('JSON parse error - %s' % six.text_type(exc))
 </s> add             raise ParseError('JSON parse error - %s' % str(exc)) </s> remove             raise ParseError('Multipart form parse error - %s' % six.text_type(exc))
 </s> add             raise ParseError('Multipart form parse error - %s' % str(exc)) </s> remove class MockUser(object):
 </s> add class MockUser: </s> remove class BaseVersioning(object):
 </s> add class BaseVersioning: </s> remove         return super(NonAtomicAPIExceptionView, self).dispatch(*args, **kwargs)
 </s> add         return super().dispatch(*args, **kwargs)
JSON_ERROR = 'JSON parse error - Expecting value:'
  from rest_framework.views import APIView
  
  factory = APIRequestFactory()
  
JSON_ERROR = 'JSON parse error - Expecting value:'
JSON_ERROR = 'JSON parse error - Expecting value:'
JSON_ERROR = 'JSON parse error - Expecting value:'
JSON_ERROR = 'JSON parse error - Expecting value:'
  
  
  class BasicView(APIView):
      def get(self, request, *args, **kwargs):
          return Response({'method': 'GET'})
keep keep keep keep replace replace replace replace keep keep keep keep keep
 Dropped Python 2 compatibility. (#6615)

Thanks to Jon Dufresne (@jdufresne) for review.

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Co-authored-by: Rizwan Mansuri <Rizwan@webbyfox.com> 
tests/test_views.py