      """
      code = None
  
      def __new__(cls, string, code=None):
          self = super(ErrorDetail, cls).__new__(cls, string)
          self.code = code
          return self
  
      def __eq__(self, other):
          r = super(ErrorDetail, self).__eq__(other)
 
</s> remove class ErrorDetail(six.text_type):
 </s> add class ErrorDetail(str): </s> remove         return super(SerializerMetaclass, cls).__new__(cls, name, bases, attrs)
 </s> add         return super().__new__(cls, name, bases, attrs) </s> remove             super(APIClient, self).logout()
 </s> add             super().logout() </s> remove         super(MethodNotAllowed, self).__init__(detail, code)
 </s> add         super().__init__(detail, code) </s> remove class BaseTokenAuthTests(object):
 </s> add class BaseTokenAuthTests:
        self = super().__new__(cls, string)
      """
      code = None
  
      def __new__(cls, string, code=None):
        self = super().__new__(cls, string)
          self.code = code
          return self
  
      def __eq__(self, other):
          r = super(ErrorDetail, self).__eq__(other)
keep keep keep keep 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> 
rest_framework/exceptions.py