Skip to content

Commit 497eab8

Browse files
Fix #6: convert dict_values to list before indexing
1 parent f7f7d82 commit 497eab8

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ parsing_profile
33
*.pyc
44
sphinxcontrib_doxylink.egg-info/
55
dist/
6+
build/

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
setup(
1111
name='sphinxcontrib-doxylink',
12-
version='1.4',
12+
version='1.5',
1313
url='http://sphinxcontrib-doxylink.readthedocs.io/en/stable/',
1414
download_url='http://pypi.python.org/pypi/sphinxcontrib-doxylink',
1515
license='BSD',

sphinxcontrib/doxylink/doxylink.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def find_url2(mapping, symbol):
231231

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

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

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

244244
if len(no_templates_list) == 1:
245-
return return_from_mapping(no_templates_list.values()[0], normalised_arglist)
245+
return return_from_mapping(list(no_templates_list.values())[0], normalised_arglist)
246246

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

249249
# If not found by now, just return the first one in the list
250250
if no_templates_list:
251251
# TODO return a warning here?
252-
return return_from_mapping(no_templates_list.values()[0], normalised_arglist)
252+
return return_from_mapping(list(no_templates_list.values())[0], normalised_arglist)
253253
# Else return None if the list is empty
254254
else:
255255
LookupError('Could not find a match')

0 commit comments

Comments
 (0)