15
0

Accepting request 948299 from devel:languages:python

- Add patch support-python-310.patch:
  * Support Python 3.10.

OBS-URL: https://build.opensuse.org/request/show/948299
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-dirtyjson?expand=0&rev=3
This commit is contained in:
2022-01-24 22:09:47 +00:00
committed by Git OBS Bridge
3 changed files with 35 additions and 2 deletions

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Jan 24 00:48:06 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch support-python-310.patch:
* Support Python 3.10.
-------------------------------------------------------------------
Tue May 18 11:03:44 UTC 2021 - pgajdos@suse.com

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-dirtyjson
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -25,6 +25,8 @@ License: MIT
Group: Development/Languages/Python
URL: https://github.com/codecobblers/dirtyjson
Source: https://files.pythonhosted.org/packages/source/d/dirtyjson/dirtyjson-%{version}.tar.gz
# PATCH-FIX-UPSTREAM gh#codecobblers/dirtyjson#6
Patch0: support-python-310.patch
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
@@ -36,7 +38,7 @@ BuildArch: noarch
JSON decoder for Python that can extract data from dirty input.
%prep
%setup -q -n dirtyjson-%{version}
%autosetup -p1 -n dirtyjson-%{version}
%build
%python_build

25
support-python-310.patch Normal file
View File

@@ -0,0 +1,25 @@
From 45d359a9e061f5a2e00d8f38817372a0e39822ae Mon Sep 17 00:00:00 2001
From: Eric Swanson <eswanson@alloscomp.com>
Date: Fri, 17 Dec 2021 11:38:13 -0500
Subject: [PATCH] Python 3.10 support
---
dirtyjson/attributed_containers.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dirtyjson/attributed_containers.py b/dirtyjson/attributed_containers.py
index c71e411..147f303 100644
--- a/dirtyjson/attributed_containers.py
+++ b/dirtyjson/attributed_containers.py
@@ -4,7 +4,10 @@
"""
try:
- from collections import MutableMapping as DictMixin
+ try:
+ from collections.abc import MutableMapping as DictMixin
+ except ImportError:
+ from collections import MutableMapping as DictMixin
py_level = 3
except ImportError:
# noinspection PyUnresolvedReferences,PyCompatibility