diff options
author | SmallJoker <mk939@ymail.com> | 2014-10-08 11:59:03 +0200 |
---|---|---|
committer | SmallJoker <mk939@ymail.com> | 2014-10-08 12:20:40 +0200 |
commit | 503b9a0125ca8c43f032a4cbb7b474195271a87a (patch) | |
tree | 94310c85e97f25c3e0bd2d5f9b79db41ebb29611 | |
parent | a4921558f37989e4554d2af418c71b0542c77c47 (diff) |
StandardError -> Exception
Try to add some python codes [untested]
-rwxr-xr-x | update_from_db.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/update_from_db.py b/update_from_db.py index 2aefcf7..be6930c 100755 --- a/update_from_db.py +++ b/update_from_db.py @@ -17,11 +17,13 @@ def addpage(page): try: c.request("GET", "/api/get.json.php?getlist&page=" + str(page) + "&outformat=base64") r = c.getresponse() - except StandardError: + except Exception: if r != 0: if r.status != 200: print("Error", r.status) exit(r.status) + return + data = r.read().decode() l = json.loads(data) if not l["success"]: @@ -41,11 +43,12 @@ def addpage(page): try: c.request("GET", "/skins/1/" + str(s["id"]) + ".png") r = c.getresponse() - except StandardError: + except Exception: if r != 0: if r.status != 200: print("Error", r.status) - exit(r.status) + continue + data = r.read() f = open(skinsdir + "character_" + str(i) + "_preview.png", "wb") f.write(data) |