From 51e6fca88fb778baf7d8f7f918d20fdc08c76f7c Mon Sep 17 00:00:00 2001 From: Marcus Huewe Date: Mon, 22 Apr 2013 15:54:55 +0200 Subject: [PATCH] - fetch: check if errno == 14 before accessing the URLGrabError's code attribute Unfortunately the class URLGrabError does not define constants for the different error codes therefore we have to hardcode the errno (alternatively we can define them in our fetch module). --- osc/fetch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osc/fetch.py b/osc/fetch.py index 51d942932c..423039869c 100644 --- a/osc/fetch.py +++ b/osc/fetch.py @@ -279,7 +279,7 @@ def run(self, buildinfo): sys.exit(0) except URLGrabError as e: # Not found is okay, let's go to the next project - if e.code != 404: + if e.errno == 14 and e.code != 404: print("Invalid answer from server", e, file=sys.stderr) sys.exit(1)