Fix traceback in gem.sources_list

ccefbd5 did not fix the problem. This should take care of it.
Merge pull request #5899 from terminalmage/issue5886

Fix traceback in gem.sources_list