| |
@@ -132,7 +132,7 @@
|
| |
**kwargs)
|
| |
r.raise_for_status()
|
| |
except requests.exceptions.RequestException as e:
|
| |
- if e.response and e.response.status_code == 401:
|
| |
+ if e.response is not None and e.response.status_code == 401:
|
| |
log.info("CCache file probably expired, removing it.")
|
| |
os.unlink(conf.krb_auth_ccache_file)
|
| |
raise
|
| |
The
requests.Response
evaluates toTrue
if it isHTTP 200 OK
,otherwise it is
False
. The code changes by this commit howeverwanted to check if
e.response
is None or set to some Response.This did not work, because even if
e.response
was set, it evaluatedto
False
, because its status code was401
.