              if not suffix_required:
                  ret.append(urlpattern)
  
              # if the original pattern was a RoutePattern we need to preserve it
              if is_route_pattern(urlpattern):
                  assert path is not None
                  assert suffix_route is not None
                  route = str(urlpattern.pattern).rstrip('$').rstrip('/') + suffix_route
                  new_pattern = path(route, view, kwargs, name)
              else:
 
</s> remove             if is_route_pattern(urlpattern):
 </s> add             if isinstance(urlpattern.pattern, RoutePattern): </s> remove             regex = get_regex_pattern(urlpattern).rstrip('$').rstrip('/') + suffix_pattern
 </s> add             regex = urlpattern.pattern.regex.pattern.rstrip('$').rstrip('/') + suffix_pattern </s> remove             path_regex = prefix + get_original_route(pattern)
 </s> add             path_regex = prefix + str(pattern.pattern) </s> remove try:
    from django.urls import (  # noqa
        URLPattern,
        URLResolver,
    )
except ImportError:
    # Will be removed in Django 2.0
    from django.urls import (  # noqa
        RegexURLPattern as URLPattern,
        RegexURLResolver as URLResolver,
    )


def get_original_route(urlpattern):
    """
    Get the original route/regex that was typed in by the user into the path(), re_path() or url() directive. This
    is in contrast with get_regex_pattern below, which for RoutePattern returns the raw regex generated from the path().
    """
    if hasattr(urlpattern, 'pattern'):
        # Django 2.0
        return str(urlpattern.pattern)
    else:
        # Django < 2.0
        return urlpattern.regex.pattern


def get_regex_pattern(urlpattern):
    """
    Get the raw regex out of the urlpattern's RegexPattern or RoutePattern. This is always a regular expression,
    unlike get_original_route above.
    """
    if hasattr(urlpattern, 'pattern'):
        # Django 2.0
        return urlpattern.pattern.regex.pattern
    else:
        # Django < 2.0
        return urlpattern.regex.pattern


def is_route_pattern(urlpattern):
    if hasattr(urlpattern, 'pattern'):
        # Django 2.0
        from django.urls.resolvers import RoutePattern
        return isinstance(urlpattern.pattern, RoutePattern)
    else:
        # Django < 2.0
        return False


def make_url_resolver(regex, urlpatterns):
    try:
        # Django 2.0
        from django.urls.resolvers import RegexPattern
        return URLResolver(RegexPattern(regex), urlpatterns)

    except ImportError:
        # Django < 2.0
        return URLResolver(regex, urlpatterns)

 </s> add  </s> remove         pairs = [(inspector.get_path_from_regex(get_regex_pattern(pattern)), pattern.callback)
 </s> add         pairs = [(inspector.get_path_from_regex(pattern.pattern.regex.pattern), pattern.callback)
            if isinstance(urlpattern.pattern, RoutePattern):
              if not suffix_required:
                  ret.append(urlpattern)
  
              # if the original pattern was a RoutePattern we need to preserve it
            if isinstance(urlpattern.pattern, RoutePattern):
                  assert path is not None
                  assert suffix_route is not None
                  route = str(urlpattern.pattern).rstrip('$').rstrip('/') + suffix_route
                  new_pattern = path(route, view, kwargs, name)
              else:
keep keep keep keep replace keep keep keep keep keep
 Drop all compat support to Django < 2 urls (#7337) 
rest_framework/urlpatterns.py