summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/monitor.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/spack/spack/monitor.py b/lib/spack/spack/monitor.py
index b4e8475e70..4c89b49b71 100644
--- a/lib/spack/spack/monitor.py
+++ b/lib/spack/spack/monitor.py
@@ -228,7 +228,7 @@ class SpackMonitorClient:
except URLError as e:
# If we have an authorization request, retry once with auth
- if e.code == 401 and retry:
+ if hasattr(e, "code") and e.code == 401 and retry:
if self.authenticate_request(e):
request = self.prepare_request(
e.url,