[obnam] Fix compatibility with Python 2.6

Michel Alexandre Salim salimma at fedoraproject.org
Wed Dec 3 04:04:21 UTC 2014


commit 334b4e5eaf2bf97779125e651115f1bca6ede569
Author: Michel Alexandre Salim <salimma at fedoraproject.org>
Date:   Wed Dec 3 11:03:31 2014 +0700

    Fix compatibility with Python 2.6

 obnam-1.8-py26.patch |   14 ++++++++++++++
 obnam.spec           |    5 +++++
 2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/obnam-1.8-py26.patch b/obnam-1.8-py26.patch
new file mode 100644
index 0000000..fc7a833
--- /dev/null
+++ b/obnam-1.8-py26.patch
@@ -0,0 +1,14 @@
+--- obnam-1.8/obnamlib/hooks_tests.py.py26	2014-05-13 14:05:26.000000000 +0700
++++ obnam-1.8/obnamlib/hooks_tests.py	2014-12-03 10:51:11.694043554 +0700
+@@ -129,8 +129,9 @@
+         self.assertEquals(self.hook.run_filter_read("base64\0AE9L"), "OK")
+ 
+     def test_no_tag_raises_error(self):
+-        with self.assertRaises(obnamlib.NoFilterTagError):
+-            self.hook.run_filter_read('no NUL bytes in this string')
++        self.assertRaises(obnamlib.NoFilterTagError,
++                          self.hook.run_filter_read,
++                          'no NUL bytes in this string')
+ 
+     def test_missing_filter_raises(self):
+         self.assertRaises(obnamlib.MissingFilterError,
diff --git a/obnam.spec b/obnam.spec
index 5910772..014509d 100644
--- a/obnam.spec
+++ b/obnam.spec
@@ -10,6 +10,8 @@ Summary:        An easy, secure backup program
 License:        GPLv3+
 URL:            http://liw.fi/obnam/
 Source0:        http://code.liw.fi/debian/pool/main/o/%{name}/%{name}_%{version}.orig.tar.gz
+# Portability fix for a unit test that uses Python 2.7 features
+Patch0:         obnam-1.8-py26.patch
 
 # build-time
 BuildRequires:  cmdtest
@@ -72,6 +74,9 @@ recommended.
 
 %prep
 %setup -q
+%if 0%{?el6}
+%patch0 -p1 -b .py26
+%endif
 
 
 %build


More information about the scm-commits mailing list