diff --git a/fix-py3k.patch b/fix-py3k.patch index 993ccbd77a28f891ce0ae704bafaa923ab677915..75cdd59013f85b6e42e53b574d631a9310ff20e9 100644 --- a/fix-py3k.patch +++ b/fix-py3k.patch @@ -1,14 +1,14 @@ -From 1a1c2a69045b7fd7a60a59e6cbc3ece0e3f8bd75 Mon Sep 17 00:00:00 2001 +From c4f29ecabd6cf1fe5b0dac4be2d9cc7ec901a32f Mon Sep 17 00:00:00 2001 From: wu-leilei Date: Tue, 8 Feb 2022 18:41:00 +0800 Subject: [PATCH] py3k --- - anyjson/__init__.py | 20 ++++++++++---------- - 1 file changed, 10 insertions(+), 10 deletions(-) + anyjson/__init__.py | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/anyjson/__init__.py b/anyjson/__init__.py -index 1f671be..0fc9ece 100644 +index 1f671be..7d68692 100644 --- a/anyjson/__init__.py +++ b/anyjson/__init__.py @@ -23,9 +23,9 @@ if sys.version_info[0] == 3: @@ -55,8 +55,12 @@ index 1f671be..0fc9ece 100644 serialize = dumps def loads(self, s): -@@ -97,8 +97,8 @@ class _JsonImplementation(object): - if self._filedecode and not isinstance(s, basestring): +@@ -94,11 +94,11 @@ class _JsonImplementation(object): + ValueError if the string could not be parsed.""" + # uses StringIO to support buffer objects. + try: +- if self._filedecode and not isinstance(s, basestring): ++ if self._filedecode and not isinstance(s, str): return self._filedecode(StringIO(s)) return self._decode(s) - except self._decode_error, exc: diff --git a/python-anyjson.spec b/python-anyjson.spec index 3c56e35ec0c2d5050bc1a340878806d1ce8cd147..e4475767afbb03e9874aaa082114d008d04af568 100644 --- a/python-anyjson.spec +++ b/python-anyjson.spec @@ -1,7 +1,7 @@ %global _empty_manifest_terminate_build 0 Name: python-anyjson Version: 0.3.3 -Release: 2 +Release: 3 Summary: Wraps the best available JSON implementation available in a common interface License: BSD URL: http://bitbucket.org/runeh/anyjson/ @@ -65,6 +65,9 @@ popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . +%postun -n python3-anyjson +rm -rf %{python3_sitelib}/anyjson + %files -n python3-anyjson -f filelist.lst %dir %{python3_sitelib}/* @@ -72,6 +75,9 @@ mv %{buildroot}/doclist.lst . %{_docdir}/* %changelog +* Tue Mar 08 2022 wangxiyuan - 0.3.3-3 +- Fix python3 error and clean up the files left over when the packged is removed + * Wed Feb 09 2022 wulei - Fix in anyjson setup command use_2to3 is invalid