Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

response.__bool__() returns False for Exception cases, so use "is not None" instead #1748

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions jira/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1566,7 +1566,7 @@ def create_issues(
# Catching case where none of the issues has been created.
# See https://github.com/pycontribs/jira/issues/350
except JIRAError as je:
if je.status_code == 400 and je.response:
if je.status_code == 400 and je.response is not None:
raw_issue_json = json.loads(je.response.text)
else:
raise
Expand Down Expand Up @@ -4620,7 +4620,7 @@ def add_user(
try:
self._session.post(url, data=payload)
except JIRAError as e:
if e.response:
if e.response is not None:
err = e.response.json()["errors"]
if (
"username" in err
Expand Down