Skip to content

Commit f8fb65d

Browse files
authored
Partial backport of #3469 (agent side only) to b0.72 (#3492)
Replace `requests.exceptions.JSONDecodeError' by generic `Exception'. See #3469 for some details. The upstream issue is psf/requests#5794 and the PR is psf/requests#5856 but we are running older versions of `requests' in various places.
1 parent b5f8011 commit f8fb65d

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lib/pbench/cli/agent/commands/results/move.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from typing import List
66

77
import click
8-
import requests
98

109
from pbench.agent.base import BaseCommand
1110
from pbench.agent.results import CopyResultTb, MakeResultTb
@@ -111,7 +110,7 @@ def execute(self, single_threaded: bool, delete: bool = True) -> int:
111110
if not res.ok:
112111
try:
113112
msg = res.json()["message"]
114-
except requests.exceptions.JSONDecodeError:
113+
except Exception:
115114
msg = res.text if res.text else res.reason
116115
raise CopyResultTb.FileUploadError(msg)
117116
except Exception as exc:

lib/pbench/cli/agent/commands/results/push.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from typing import List
44

55
import click
6-
import requests
76

87
from pbench.agent.base import BaseCommand
98
from pbench.agent.results import CopyResultTb
@@ -36,7 +35,7 @@ def execute(self) -> int:
3635

3736
try:
3837
msg = res.json()["message"]
39-
except requests.exceptions.JSONDecodeError:
38+
except Exception:
4039
msg = res.text if res.text else res.reason
4140

4241
# dup or other unexpected but non-error status

0 commit comments

Comments
 (0)