]> git.lizzy.rs Git - cheatdb.git/commitdiff
Fix crash on reading mod.conf from Github v1.16.3
authorrubenwardy <rw@rubenwardy.com>
Fri, 9 Aug 2019 10:27:54 +0000 (11:27 +0100)
committerrubenwardy <rw@rubenwardy.com>
Fri, 9 Aug 2019 10:27:54 +0000 (11:27 +0100)
app/tasks/importtasks.py

index 465e3c2213430c0d3ba325dc9aa649c701a89db2..108f1b349e1d53e57723de7c0d2694229a99d86c 100644 (file)
@@ -55,6 +55,9 @@ class GithubURLMaker:
        def getScreenshotURL(self):
                return self.baseUrl + "/screenshot.png"
 
+       def getModConfURL(self):
+               return self.baseUrl + "/mod.conf"
+
        def getCommitsURL(self, branch):
                return "https://api.github.com/repos/{}/{}/commits?sha={}" \
                                .format(self.user, self.repo, urllib.parse.quote_plus(branch))
@@ -346,7 +349,7 @@ def makeVCSReleaseFromGithub(id, branch, release, url):
        try:
                contents = urllib.request.urlopen(commitsURL).read().decode("utf-8")
                commits = json.loads(contents)
-       except urllib.error.HTTPError:
+       except HTTPError:
                raise TaskError("Unable to get commits for Github repository. Either the repository or reference doesn't exist.")
 
        if len(commits) == 0 or not "sha" in commits[0]: