Skip to content

Commit

Permalink
Fix #6: convert dict_values to list before indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
SteinHeselmans committed Dec 6, 2017
1 parent f7f7d82 commit 497eab8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ parsing_profile
*.pyc
sphinxcontrib_doxylink.egg-info/
dist/
build/
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name='sphinxcontrib-doxylink',
version='1.4',
version='1.5',
url='http://sphinxcontrib-doxylink.readthedocs.io/en/stable/',
download_url='http://pypi.python.org/pypi/sphinxcontrib-doxylink',
license='BSD',
Expand Down
6 changes: 3 additions & 3 deletions sphinxcontrib/doxylink/doxylink.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def find_url2(mapping, symbol):

# If there is only one by here we return it.
if len(classes_list) is 1:
return classes_list.values()[0]
return list(classes_list.values())[0]

#print("Still", len(classes_list), 'possible matches')

Expand All @@ -242,14 +242,14 @@ def find_url2(mapping, symbol):
no_templates_list = find_url_remove_templates(classes_list, symbol)

if len(no_templates_list) == 1:
return return_from_mapping(no_templates_list.values()[0], normalised_arglist)
return return_from_mapping(list(no_templates_list.values())[0], normalised_arglist)

#print("Still", len(no_templates_list), 'possible matches')

# If not found by now, just return the first one in the list
if no_templates_list:
# TODO return a warning here?
return return_from_mapping(no_templates_list.values()[0], normalised_arglist)
return return_from_mapping(list(no_templates_list.values())[0], normalised_arglist)
# Else return None if the list is empty
else:
LookupError('Could not find a match')
Expand Down

0 comments on commit 497eab8

Please sign in to comment.