From 6bca6b90b59890a764c0284ebf4d0fcea6735c2b26e4a7f883e16df34de280b5 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 24 Jan 2022 00:48:48 +0000 Subject: [PATCH] - Add patch support-python-310.patch: * Support Python 3.10. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dirtyjson?expand=0&rev=5 --- python-dirtyjson.changes | 6 ++++++ python-dirtyjson.spec | 6 ++++-- support-python-310.patch | 25 +++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 support-python-310.patch diff --git a/python-dirtyjson.changes b/python-dirtyjson.changes index 5c9995f..18222d7 100644 --- a/python-dirtyjson.changes +++ b/python-dirtyjson.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jan 24 00:48:06 UTC 2022 - Steve Kowalik + +- Add patch support-python-310.patch: + * Support Python 3.10. + ------------------------------------------------------------------- Tue May 18 11:03:44 UTC 2021 - pgajdos@suse.com diff --git a/python-dirtyjson.spec b/python-dirtyjson.spec index faecf63..1b0fca1 100644 --- a/python-dirtyjson.spec +++ b/python-dirtyjson.spec @@ -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 diff --git a/support-python-310.patch b/support-python-310.patch new file mode 100644 index 0000000..6edf49e --- /dev/null +++ b/support-python-310.patch @@ -0,0 +1,25 @@ +From 45d359a9e061f5a2e00d8f38817372a0e39822ae Mon Sep 17 00:00:00 2001 +From: Eric Swanson +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