Skip to content

Commit 5654661

Browse files
authored
Merge pull request #17 from ftpsolutions/fix-pypi-check
Fix PyPi check since PyPi changed their HTML structure
2 parents 3c14a4a + bab21fe commit 5654661

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

third_party_license_file_generator/licenses/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ def get_license_from_pypi_license_scrape(module_name):
115115
if r.status_code != 200:
116116
return None
117117

118-
return r.text.split("<p><strong>License:</strong>")[-1].split("</p>")[0].strip().split("\n")[0]
118+
match = re.search("License:</.+>([^<]+)", r.text)
119+
return match.group(1).strip() if match is not None else None
119120

120121

121122
def get_license_from_github_home_page_scrape(url):

0 commit comments

Comments
 (0)