          try:
              return queryset.get(**lookup_kwargs)
          except ValueError:
              exc = ObjectValueError(str(sys.exc_info()[1]))
              six.reraise(type(exc), exc, sys.exc_info()[2])
          except TypeError:
              exc = ObjectTypeError(str(sys.exc_info()[1]))
              six.reraise(type(exc), exc, sys.exc_info()[2])
  
      def get_url(self, obj, view_name, request, format):
 
</s> remove             six.reraise(type(exc), exc, sys.exc_info()[2])
 </s> add             raise exc.with_traceback(sys.exc_info()[2]) </s> remove         six.reraise(type(exc), exc, info[2])
 </s> add         raise exc.with_traceback(info[2]) </s> remove class Empty(object):
 </s> add class Empty: </s> remove             field.run_validation(u'slug-99-\u0420')
 </s> add             field.run_validation('slug-99-\u0420') </s> remove             filename = urlparse.unquote(filename)
 </s> add             filename = parse.unquote(filename)
            raise exc.with_traceback(sys.exc_info()[2])
          try:
              return queryset.get(**lookup_kwargs)
          except ValueError:
              exc = ObjectValueError(str(sys.exc_info()[1]))
            raise exc.with_traceback(sys.exc_info()[2])
          except TypeError:
              exc = ObjectTypeError(str(sys.exc_info()[1]))
              six.reraise(type(exc), exc, sys.exc_info()[2])
  
      def get_url(self, obj, view_name, request, format):
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/relations.py