forked from pool/python-isodate
- Add patch coerce-decimal-to-int-python-310.patch:
* Support Python 3.10. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-isodate?expand=0&rev=29
This commit is contained in:
parent
95ebc3126d
commit
854684b73b
37
coerce-decimal-to-int-python-310.patch
Normal file
37
coerce-decimal-to-int-python-310.patch
Normal file
@ -0,0 +1,37 @@
|
||||
From 201720a3717426c33ff114b3169ac6d7d29de2c0 Mon Sep 17 00:00:00 2001
|
||||
From: Hugo van Kemenade <hugovk@users.noreply.github.com>
|
||||
Date: Mon, 13 Sep 2021 12:38:36 +0300
|
||||
Subject: [PATCH 3/4] Fix for Python 3.10: TypeError: 'decimal.Decimal' object
|
||||
cannot be interpreted as an integer
|
||||
|
||||
---
|
||||
src/isodate/duration.py | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/isodate/duration.py b/src/isodate/duration.py
|
||||
index 6d1848c..4b83e45 100644
|
||||
--- a/src/isodate/duration.py
|
||||
+++ b/src/isodate/duration.py
|
||||
@@ -180,7 +180,9 @@ def __add__(self, other):
|
||||
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=int(newday)
|
||||
+ )
|
||||
# does a timedelta + date/datetime
|
||||
return self.tdelta + newdt
|
||||
except AttributeError:
|
||||
@@ -264,7 +266,9 @@ def __rsub__(self, other):
|
||||
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=int(newday)
|
||||
+ )
|
||||
return newdt - self.tdelta
|
||||
except AttributeError:
|
||||
# other probably was not compatible with data/datetime
|
||||
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Dec 13 01:44:25 UTC 2021 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Add patch coerce-decimal-to-int-python-310.patch:
|
||||
* Support Python 3.10.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Nov 8 10:20:27 UTC 2021 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
|
@ -22,9 +22,10 @@ Version: 0.6.0
|
||||
Release: 0
|
||||
Summary: An ISO 8601 Date/Time/Duration Parser and Formatter
|
||||
License: BSD-3-Clause
|
||||
Group: Development/Languages/Python
|
||||
URL: https://pypi.org/project/isodate/
|
||||
Source: https://files.pythonhosted.org/packages/source/i/isodate/isodate-%{version}.tar.gz
|
||||
# PATCH-FIX-UPSTREAM gh#gweis/isodate#68
|
||||
Patch0: coerce-decimal-to-int-python-310.patch
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module six}
|
||||
BuildRequires: fdupes
|
||||
@ -42,6 +43,7 @@ option.
|
||||
|
||||
%prep
|
||||
%setup -q -n isodate-%{version}
|
||||
%autopatch -p1
|
||||
|
||||
%build
|
||||
%python_build
|
||||
|
Loading…
x
Reference in New Issue
Block a user