From: JinWang An Date: Mon, 20 Feb 2023 07:44:04 +0000 (+0900) Subject: Migration for python 3.11 X-Git-Tag: accepted/tizen/unified/20230307.054630 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Ftags%2Faccepted%2Ftizen%2Funified%2F20230307.054630;p=platform%2Fupstream%2Fpython-PyYAML.git Migration for python 3.11 Change-Id: I3e5c6d71e265cc5764c8d2d7af01692a8b903c49 Signed-off-by: JinWang An --- diff --git a/packaging/Migration_for_python_3.11.patch b/packaging/Migration_for_python_3.11.patch new file mode 100644 index 0000000..d7cee6c --- /dev/null +++ b/packaging/Migration_for_python_3.11.patch @@ -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) diff --git a/packaging/python-PyYAML.spec b/packaging/python-PyYAML.spec index 8398534..2431f3e 100644 --- a/packaging/python-PyYAML.spec +++ b/packaging/python-PyYAML.spec @@ -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