summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Eduardo <jose.eduardo.gd@gmail.com>2019-07-19 16:29:43 +0100
committerJose Eduardo <jose.eduardo.gd@gmail.com>2019-07-19 16:29:43 +0100
commitfc0fb3278da5f463ca5b2f0a3acafbbf2869bd7a (patch)
tree8865eea9b4a4368336e6f6507307a29d15925e4b
parentb4e3d2a3efeb4805dd3058242178c1d480beeb9f (diff)
downloadisodate-fc0fb3278da5f463ca5b2f0a3acafbbf2869bd7a.tar.gz
Fix Python 3.8 DeprecationWarning
Ref: https://docs.python.org/3.8/whatsnew/3.8.html > Many builtin and extension functions that take integer arguments will > now emit a deprecation warning for Decimals, Fractions and any other > objects that can be converted to integers only with a loss (e.g. that > have the `__int__()` method but do not have the `__index__()` method). > In future version they will be errors. (Contributed by Serhiy > Storchaka in bpo-36048.)
-rw-r--r--src/isodate/duration.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/isodate/duration.py b/src/isodate/duration.py
index 6d1848c..d923cee 100644
--- a/src/isodate/duration.py
+++ b/src/isodate/duration.py
@@ -180,7 +180,7 @@ class Duration(object):
newday = maxdays
else:
newday = other.day
- newdt = other.replace(year=newyear, month=newmonth, day=newday)
+ newdt = other.replace(year=int(newyear), month=int(newmonth), day=newday)
# does a timedelta + date/datetime
return self.tdelta + newdt
except AttributeError:
@@ -264,7 +264,7 @@ class Duration(object):
newday = maxdays
else:
newday = other.day
- newdt = other.replace(year=newyear, month=newmonth, day=newday)
+ newdt = other.replace(year=int(newyear), month=int(newmonth), day=newday)
return newdt - self.tdelta
except AttributeError:
# other probably was not compatible with data/datetime