From 4e0dcede3e73c9459d07fde14a8c4b407a8ad92b0bae472de68553ebb734ad62 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 16 Feb 2023 22:40:09 +0000 Subject: [PATCH] - add fix-formatted-value.patch - skip tests on 32bit platforms OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-astunparse?expand=0&rev=12 --- fix-formatted-value.patch | 23 +++++++++++++++++++++++ python-astunparse.changes | 6 ++++++ python-astunparse.spec | 7 ++++++- 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 fix-formatted-value.patch 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..abbba69 100644 --- a/python-astunparse.changes +++ b/python-astunparse.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +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..50d0a09 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} @@ -61,7 +63,10 @@ Added to this is a pretty-printing dump utility function. %python_expand %fdupes %{buildroot}%{$python_sitelib} %check +# fails to parse the 32bit stdlib +%ifnarch %ix86 %arm32 %pyunittest discover -v +%endif %files %{python_files} %doc AUTHORS.rst README.rst HISTORY.rst