@@ -67,8 +67,7 @@ def ensure_simple(
6767 how would one know that it's there?*
6868 """
6969
70- def explore_links (page_url , page_name , links_found ):
71- msgs = ""
70+ def explore_links (page_url , page_name , links_found , msgs ):
7271 legit_found_links = []
7372 page_content = requests .get (page_url ).text
7473 page = html .fromstring (page_content )
@@ -92,18 +91,15 @@ def explore_links(page_url, page_name, links_found):
9291 msgs += f"\n Found { page_name } link without href { link .text } "
9392 else :
9493 msgs += f"\n Found extra { page_name } link { link .text } "
95- return legit_found_links , msgs
94+ return legit_found_links
9695
9796 packages_found = {name : False for name in packages .keys ()}
9897 releases_found = {name : False for releases in packages .values () for name in releases }
99- found_release_links , msgs = explore_links (simple_url , "simple" , packages_found )
98+ msgs = ""
99+ found_release_links = explore_links (simple_url , "simple" , packages_found , msgs )
100100 dl_links = []
101101 for rel_link in found_release_links :
102- new_links , new_msgs = explore_links (
103- urljoin (simple_url , rel_link ), "release" , releases_found
104- )
105- dl_links += new_links
106- msgs += new_msgs
102+ dl_links += explore_links (urljoin (simple_url , rel_link ), "release" , releases_found , msgs )
107103 for dl_link in dl_links :
108104 package_link , _ , sha = dl_link .partition ("#sha256=" )
109105 if len (sha ) != 64 :
0 commit comments