Skip to content

Commit f8c4d05

Browse files
committed
Fixed None as value for a function
- Turns None into an empty string
1 parent 5c86d51 commit f8c4d05

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bumpversion/versioning/functions.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ class IndependentFunction(PartFunction):
2323
"""
2424

2525
def __init__(self, value: Union[str, int, None] = None):
26+
if value is None:
27+
value = ""
2628
self.first_value = str(value)
2729
self.optional_value = str(value)
2830
self.independent = True
2931

30-
def bump(self, value: str) -> str:
32+
def bump(self, value: Optional[str] = None) -> str:
3133
"""Return the optional value."""
32-
return self.optional_value
34+
return value or self.optional_value
3335

3436

3537
class NumericFunction(PartFunction):

0 commit comments

Comments
 (0)