Migration for python 3.11 00/288600/1 accepted/tizen_8.0_unified accepted/tizen_unified_riscv tizen_8.0 accepted/tizen/8.0/unified/20231005.095413 accepted/tizen/unified/20230302.065120 accepted/tizen/unified/20230307.054630 accepted/tizen/unified/riscv/20230724.003542 tizen_8.0_m2_release
authorJinWang An <jinwang.an@samsung.com>
Mon, 20 Feb 2023 07:44:04 +0000 (16:44 +0900)
committerJinWang An <jinwang.an@samsung.com>
Mon, 20 Feb 2023 07:44:36 +0000 (16:44 +0900)
Change-Id: I3e5c6d71e265cc5764c8d2d7af01692a8b903c49
Signed-off-by: JinWang An <jinwang.an@samsung.com>
packaging/Migration_for_python_3.11.patch [new file with mode: 0644]
packaging/python-PyYAML.spec

diff --git a/packaging/Migration_for_python_3.11.patch b/packaging/Migration_for_python_3.11.patch
new file mode 100644 (file)
index 0000000..d7cee6c
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/lib3/yaml/constructor.py b/lib3/yaml/constructor.py
+index 981543a..6222808 100644
+--- a/lib3/yaml/constructor.py
++++ b/lib3/yaml/constructor.py
+@@ -123,7 +123,7 @@ class BaseConstructor:
+         mapping = {}
+         for key_node, value_node in node.value:
+             key = self.construct_object(key_node, deep=deep)
+-            if not isinstance(key, collections.Hashable):
++            if not isinstance(key, collections.abc.Hashable):
+                 raise ConstructorError("while constructing a mapping", node.start_mark,
+                         "found unhashable key", key_node.start_mark)
+             value = self.construct_object(value_node, deep=deep)
index 8398534..2431f3e 100644 (file)
@@ -7,6 +7,7 @@ License:        MIT
 Group:          Development/Languages/Python
 Source:         http://pypi.python.org/packages/source/P/PyYAML/PyYAML-%{version}.tar.gz
 Source1001:    python-PyYAML.manifest
+Source1002:    Migration_for_python_3.11.patch
 BuildRequires:  python-devel
 BuildRequires:  python-nose
 BuildRequires: python3-devel
@@ -49,6 +50,7 @@ configuration files to object serialization and persistance.
 %prep
 %setup -q -n PyYAML-%{version}
 cp %{SOURCE1001} .
+%{__patch} -p1 < %{SOURCE1002}
 
 %build
 CFLAGS="%{optflags}" python setup.py build