[packages/python-fs] - rel 4, fix test incompatibility between python2 and python3
baggins
baggins at pld-linux.org
Sun Mar 23 19:29:03 CET 2025
commit f34aaaf5506cf486fc2c498f1a3527468ad03946
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Sun Mar 23 20:09:44 2025 +0100
- rel 4, fix test incompatibility between python2 and python3
python-fs.spec | 4 +++-
test.patch | 14 ++++++++++++++
2 files changed, 17 insertions(+), 1 deletion(-)
---
diff --git a/python-fs.spec b/python-fs.spec
index 4294d20..63592c5 100644
--- a/python-fs.spec
+++ b/python-fs.spec
@@ -9,12 +9,13 @@ Summary: Filesystem abstraction layer for Python 2
Summary(pl.UTF-8): Warstwa abstrakcji systemu plików dla Pythona 2
Name: python-fs
Version: 2.4.16
-Release: 3
+Release: 4
License: MIT
Group: Libraries/Python
#Source0Download: https://pypi.org/simple/fs/
Source0: https://files.pythonhosted.org/packages/source/f/fs/fs-%{version}.tar.gz
# Source0-md5: 2c9dae3d52950407fe265c3576396c33
+Patch0: test.patch
URL: https://pypi.org/project/fs/
%if %{with tests} && %(locale -a | grep -q '^C\.utf8$'; echo $?)
BuildRequires: glibc-localedb-all
@@ -101,6 +102,7 @@ Dokumentacja API modułu Pythona fs.
%prep
%setup -q -n fs-%{version}
+%patch -P 0 -p1
# relies on pyftpdlib tests
%{__rm} tests/test_ftpfs.py
diff --git a/test.patch b/test.patch
new file mode 100644
index 0000000..8e122fa
--- /dev/null
+++ b/test.patch
@@ -0,0 +1,14 @@
+--- fs-2.4.16/fs/test.py~ 2022-05-02 11:22:31.000000000 +0200
++++ fs-2.4.16/fs/test.py 2025-03-23 20:07:18.199982870 +0100
+@@ -1082,7 +1082,10 @@
+ self.fs.makedirs("foo/bar/baz/")
+
+ error_msg = "resource 'foo/bar/egg/test.txt' not found"
+- assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp)
++ if six.PY2:
++ assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp)
++ else:
++ assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegex)
+ with assertRaisesRegex(errors.ResourceNotFound, error_msg):
+ self.fs.remove("foo/bar/egg/test.txt")
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-fs.git/commitdiff/f34aaaf5506cf486fc2c498f1a3527468ad03946
More information about the pld-cvs-commit
mailing list