Skip to content

Commit

Permalink
fix: change return value to "None" in case getattr returns None to pr…
Browse files Browse the repository at this point in the history
…event error
  • Loading branch information
pinxue authored and nejch committed Dec 19, 2022
1 parent 43b369f commit 3f86d36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gitlab/v4/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ def display_dict(d: Dict[str, Any], padding: int) -> None:
id = getattr(obj, obj._id_attr)
print(f"{obj._id_attr.replace('_', '-')}: {id}")
if obj._repr_attr:
value = getattr(obj, obj._repr_attr, "None")
value = getattr(obj, obj._repr_attr, "None") or "None"
value = value.replace("\r", "").replace("\n", " ")
# If the attribute is a note (ProjectCommitComment) then we do
# some modifications to fit everything on one line
Expand Down

0 comments on commit 3f86d36

Please sign in to comment.