Skip to content

Commit

Permalink
Fix faulty version repr
Browse files Browse the repository at this point in the history
If no desc is present, we don't want to add a trailing "+".
  • Loading branch information
mara004 committed Oct 19, 2023
1 parent 9c5f0ba commit 7b08870
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/devel/changelog_staging.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
<!-- List character: dash (-) -->

# Changelog for next release
- Fixed faulty version repr (avoid trailing `+` if desc is empty).
5 changes: 4 additions & 1 deletion src/pypdfium2/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ def __setattr__(self, name, value):

@cached_property
def version(self):
return f"{self.tag}+{self.desc}"
v = str(self.tag)
if self.desc:
v += "+" + str(self.desc)
return v

def __repr__(self):
return self.version
Expand Down

0 comments on commit 7b08870

Please sign in to comment.