diff --git a/fix-formatted-value.patch b/fix-formatted-value.patch new file mode 100644 index 0000000..950b353 --- /dev/null +++ b/fix-formatted-value.patch @@ -0,0 +1,23 @@ +From 3c661cb35b62268a553dd548a73178b5d7f708c7 Mon Sep 17 00:00:00 2001 +From: Vincent Hellendoorn +Date: Tue, 29 Sep 2020 14:11:11 -0400 +Subject: [PATCH] Use correct write call for FormattedValue + +The unparser for formatted values incorrectly referred to `_fstring_JoinedStr`, which expects a `values` property that `FormattedValue`s don't have. This PR updates to the correct call. +--- + lib/astunparse/unparser.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/astunparse/unparser.py b/lib/astunparse/unparser.py +index 0ef6fd8..7e8c1ca 100644 +--- a/lib/astunparse/unparser.py ++++ b/lib/astunparse/unparser.py +@@ -482,7 +482,7 @@ def _FormattedValue(self, t): + # FormattedValue(expr value, int? conversion, expr? format_spec) + self.write("f") + string = StringIO() +- self._fstring_JoinedStr(t, string.write) ++ self._fstring_FormattedValue(t, string.write) + self.write(repr(string.getvalue())) + + def _fstring_JoinedStr(self, t, write): diff --git a/python-astunparse.changes b/python-astunparse.changes index a77e1a3..9d85966 100644 --- a/python-astunparse.changes +++ b/python-astunparse.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Fri Feb 17 10:59:59 UTC 2023 - Dirk Müller + +- need to turn off noarch to be able to skip tests on 32bit arches + +------------------------------------------------------------------- +Thu Feb 16 22:39:53 UTC 2023 - Dirk Müller + +- add fix-formatted-value.patch +- skip tests on 32bit platforms + ------------------------------------------------------------------- Fri Sep 10 05:23:39 UTC 2021 - pgajdos@suse.com diff --git a/python-astunparse.spec b/python-astunparse.spec index 913fb12..ebf20d0 100644 --- a/python-astunparse.spec +++ b/python-astunparse.spec @@ -1,7 +1,7 @@ # # spec file for package python-astunparse # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -27,6 +27,8 @@ URL: https://github.com/simonpercivall/astunparse Source: https://files.pythonhosted.org/packages/source/a/astunparse/astunparse-%{version}.tar.gz # PATCH-FIX-UPSTREAM astunparse-pr57-py39.patch -- gh#simonpercivall/astunparse#57 Patch0: astunparse-pr57-py39.patch +# https://github.com/simonpercivall/astunparse/pull/59 +Patch1: fix-formatted-value.patch BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six >= 1.6.1} BuildRequires: %{python_module wheel >= 0.23.0} @@ -34,7 +36,6 @@ BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-six >= 1.6.1 Requires: python-wheel >= 0.23.0 -BuildArch: noarch %python_subpackages %description @@ -60,8 +61,11 @@ Added to this is a pretty-printing dump utility function. %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} +# fails to parse the 32bit stdlib +%if "%_lib" == "lib64" %check %pyunittest discover -v +%endif %files %{python_files} %doc AUTHORS.rst README.rst HISTORY.rst