Skip to content

Commit

Permalink
Fix mypy errors that were a false positive
Browse files Browse the repository at this point in the history
  • Loading branch information
mprpic committed Jan 25, 2024
1 parent 965b9e5 commit 29f5540
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cvelib/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,13 @@ def wrapped(*args: Any, **kwargs: Any) -> Callable:
return func(*args, **kwargs)
except requests.exceptions.RequestException as exc:
error = str(exc)
details = None
if getattr(exc, "response", None) is not None:
details = ""
response = getattr(exc, "response", None)
if response is not None:
try:
details = exc.response.json()
details = str(response.json())
except ValueError:
details = exc.response.content
details = response.content.decode("utf-8")
print_error(error, details)
except CveRecordValidationError as exc:
click.secho("ERROR: ", bold=True, nl=False)
Expand Down

0 comments on commit 29f5540

Please sign in to comment.