Skip to content

Commit

Permalink
compatibility with python 3.6 marcgibbons#2
Browse files Browse the repository at this point in the history
  • Loading branch information
kirill1194 committed Nov 25, 2017
1 parent 4ec7ae1 commit 1044f61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rest_framework_swagger/urlparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ def __filter_top_level_apis__(self, root_paths):
Returns top level APIs
"""
filtered_paths = set()
base_path = list(self.__get_base_path__(root_paths))
base_path = self.__get_base_path__(root_paths)
for path in root_paths:
resource = path.replace(base_path, '').split('/')[0]
filtered_paths.add(base_path + resource)

return list(filtered_paths)

def __get_base_path__(self, root_paths):
base_path = os.path.commonprefix(root_paths)
base_path = os.path.commonprefix(list(root_paths))
slash_index = base_path.rfind('/') + 1
base_path = base_path[:slash_index]

Expand Down

0 comments on commit 1044f61

Please sign in to comment.