Merge pull request #247 from rycee/fix/gitlab-update

This commit is contained in:
Jörg Thalheim 2020-07-03 22:57:12 +01:00 committed by GitHub
commit 693c27b5d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,9 +13,10 @@ from .manifest import LockedVersion, Repo, RepoType
def fetch_commit_from_feed(url: str) -> str:
req = urllib.request.urlopen(url)
req = urllib.request.Request(url, headers={"User-Agent": "nur-updater"})
res = urllib.request.urlopen(req)
try:
xml = req.read()
xml = res.read()
root = ET.fromstring(xml)
ns = "{http://www.w3.org/2005/Atom}"
xpath = f"./{ns}entry/{ns}link"