Skip to content

Commit fbf8bf5

Browse files
Fix empty package list bug in cpan authors
Signed-off-by: Ayan Sinha Mahapatra <asmahapatra@aboutcode.org>
1 parent 31efe8b commit fbf8bf5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

minecode_pipelines/miners/cpan.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ def get_cpan_packageurls(name, path_prefix, logger=None):
120120
soup = BeautifulSoup(response.text, "html.parser")
121121

122122
# We get all the listed packages in the author page index
123-
package_list_elements = soup.find("ul").text.split("\n")
123+
package_list = soup.find("ul")
124+
if not package_list:
125+
return packageurls
126+
127+
package_list_elements = package_list.text.split("\n")
124128

125129
package_elements = [
126130
element.replace(" ", "")

0 commit comments

Comments
 (0)