Closed JoseKilo closed 2 years ago
Fixed in the fork at https://github.com/isodate/isodate/pull/1, also ditches Travis CI for GitHub Actions.
@hugovk Thanks for the fix!
In your commit you also converted newday
to int
whereas the original code seems to allow floats for days.
The check above seems to imply the day can be floats.
if (not(float(self.years).is_integer() and
float(self.months).is_integer())):
raise ValueError('fractional years or months not supported'
' for date calculations')
Also, maybe we should add a check for other
here too. We mostly only add two values together, if we use int()
in the end, one of them (e.g. self.months
) is known to be integral, the other (other.month
) has to be integral too in order to for the conversion to be lossless.
Could you please have another look? Thanks again!
Perhaps it would help to open a new issue and include example code showing how this worked before and what the expected output would be before compared to now?
Using python3.8, with
-Werror
It looks like casting to int explicitly would solve the warning, something like:
According to the release notes: https://docs.python.org/3.8/whatsnew/3.8.html