diff options
Diffstat (limited to 'contrib/caldav')
-rwxr-xr-x | contrib/caldav/calcurse-caldav.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/caldav/calcurse-caldav.py b/contrib/caldav/calcurse-caldav.py index 262f4ee..ff6bdc1 100755 --- a/contrib/caldav/calcurse-caldav.py +++ b/contrib/caldav/calcurse-caldav.py @@ -102,11 +102,6 @@ def remote_query(cmd, path, additional_headers, body): if not resp: return (None, None) - if resp.status - (resp.status % 100) != 200: - die(("The server at %s replied with HTTP status code %d (%s) " + - "while trying to access %s.") % - (hostname, resp.status, resp.reason, path)) - headers = resp.getheaders() body = resp.read().decode('utf-8') @@ -116,6 +111,11 @@ def remote_query(cmd, path, additional_headers, body): print("< " + line) print() + if resp.status - (resp.status % 100) != 200: + die(("The server at %s replied with HTTP status code %d (%s) " + + "while trying to access %s.") % + (hostname, resp.status, resp.reason, path)) + return (headers, body) def get_hrefmap(conn, uid=None): |