[python-ruledispatch] Fix problems exposed by python-2.7

Toshio くらとみ toshio at fedoraproject.org
Sun Aug 1 04:52:19 UTC 2010


commit dae65ced4a0b32dadf913f25d45cca2708c1ca3d
Author: Toshio Kuratomi <toshio at fedoraproject.org>
Date:   Sat Jul 31 20:31:54 2010 -0400

    Fix problems exposed by python-2.7

 python-ruledispatch.spec |   15 +++++++++------
 ruledispatch-py27.patch  |   29 +++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+), 6 deletions(-)
---
diff --git a/python-ruledispatch.spec b/python-ruledispatch.spec
index 4cb0008..e71f515 100644
--- a/python-ruledispatch.spec
+++ b/python-ruledispatch.spec
@@ -1,11 +1,9 @@
-%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
-%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
-%{!?pyver: %define pyver %(%{__python} -c "import sys ; print sys.version[:3]")}
-%define svnrev r2506
+%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
+%global svnrev r2506
 
 Name:           python-ruledispatch
 Version:        0.5a1
-Release:        0.17.svn%{svnrev}%{?dist}
+Release:        0.18.svn%{svnrev}%{?dist}
 Summary:        A generic function package for Python
 
 Group:          Development/Languages
@@ -14,6 +12,7 @@ URL:            http://www.turbogears.org
 Source0:        http://files.turbogears.org/eggs/RuleDispatch-%{version}.dev-%{svnrev}.tar.gz
 Patch0:         python-ruledispatch-0.5a0-py26keyword.patch
 Patch1:         python-ruledispatch-ez_setup.patch
+Patch2: ruledispatch-py27.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  python-devel python-setuptools-devel
@@ -29,6 +28,7 @@ Rule-based Dispatching and Generic Functions.
 %setup -q -n RuleDispatch-%{version}.dev-%{svnrev}
 %patch0 -p 1 -b .keyword
 %patch1 -p0 -b .ez_setup
+%patch2 -p1 -b .ne
 
 %build
 CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
@@ -49,7 +49,7 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(-,root,root,-)
 %doc combiners.txt TODO.txt 
-%{python_sitearch}/RuleDispatch-%{version}.dev_%{svnrev}-py%{pyver}.egg-info
+%{python_sitearch}/RuleDispatch-%{version}.dev_%{svnrev}-*.egg-info
 %dir %{python_sitearch}/dispatch
 %{python_sitearch}/dispatch/*.py
 %{python_sitearch}/dispatch/_d_speedups.so
@@ -61,6 +61,9 @@ rm -rf $RPM_BUILD_ROOT
 %{python_sitearch}/dispatch/tests/*.pyo
 
 %changelog
+* Sat Jul 31 2010 Toshio Kuratomi <toshoi at fedoraproject.org> - 0.5a1-0.18.svnr2506
+- Fix incomplete rich comparisons
+
 * Thu Jul 22 2010 David Malcolm <dmalcolm at redhat.com> - 0.5a1-0.17.svnr2506
 - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
 
diff --git a/ruledispatch-py27.patch b/ruledispatch-py27.patch
new file mode 100644
index 0000000..baab46d
--- /dev/null
+++ b/ruledispatch-py27.patch
@@ -0,0 +1,29 @@
+
+Index: RuleDispatch-0.5a1.dev-r2506/src/dispatch/ast_builder.py
+===================================================================
+--- RuleDispatch-0.5a1.dev-r2506.orig/src/dispatch/ast_builder.py
++++ RuleDispatch-0.5a1.dev-r2506/src/dispatch/ast_builder.py
+@@ -55,7 +55,9 @@ def com_binary(opname, builder,nodelist)
+ testlist = subscriptlist = curry(com_binary, 'Tuple')
+ 
+ # testlist_gexp test (gen_for | (',' test)* [','])
++# In python-2.7+, testlist_comp replaces testlist_gexp
+ testlist_gexp = testlist    # XXX
++testlist_comp = testlist    # XXX
+ 
+ # test: and_test ('or' and_test)* | lambdef
+ test = curry(com_binary, 'Or')
+Index: RuleDispatch-0.5a1.dev-r2506/src/dispatch/strategy.py
+===================================================================
+--- RuleDispatch-0.5a1.dev-r2506.orig/src/dispatch/strategy.py
++++ RuleDispatch-0.5a1.dev-r2506/src/dispatch/strategy.py
+@@ -548,6 +548,9 @@ class Pointer(int):
+     def __eq__(self,other):
+         return self is other or int(self)==other and self.ref() is not None
+ 
++    def __ne__(self, other):
++        return not self.__eq__(other)
++
+     def __repr__(self):
+         if self.ref() is None:
+             return "Pointer(<invalid at 0x%s>)" % hex(self)


More information about the scm-commits mailing list