as is a special keyword in python2.6. rename it to dispatch_as;

unbreaking build for MODPY_VERSION=2.6.  noticed by sthen@ in a bulk build
fgs@ ok
This commit is contained in:
martynas 2009-08-06 23:36:44 +00:00
parent d54e3414ed
commit bdcef3b25b
3 changed files with 44 additions and 2 deletions

View File

@ -1,11 +1,11 @@
# $OpenBSD: Makefile,v 1.6 2009/04/05 02:07:40 martynas Exp $
# $OpenBSD: Makefile,v 1.7 2009/08/06 23:36:44 martynas Exp $
COMMENT= rule-based dispatching and generic functions
VERSION= 0.5
REVISION= 2306
DISTNAME= RuleDispatch
PKGNAME= py-ruledispatch-${VERSION}r${REVISION}p1
PKGNAME= py-ruledispatch-${VERSION}r${REVISION}p2
CATEGORIES= devel

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_dispatch___init___py,v 1.1 2009/08/06 23:36:44 martynas Exp $
--- src/dispatch/__init__.py.orig Wed Apr 25 07:01:44 2007
+++ src/dispatch/__init__.py Wed Aug 5 18:48:17 2009
@@ -95,7 +95,7 @@ def generic(combiner=None):
return decorate_assignment(callback)
-def as(*decorators):
+def dispatch_as(*decorators):
"""Use Python 2.4 decorators w/Python 2.2+
Example:

View File

@ -0,0 +1,30 @@
$OpenBSD: patch-src_dispatch_predicates_py,v 1.1 2009/08/06 23:36:44 martynas Exp $
--- src/dispatch/predicates.py.orig Wed Apr 25 07:01:44 2007
+++ src/dispatch/predicates.py Wed Aug 5 18:48:17 2009
@@ -236,7 +236,7 @@ class OrExpr(LogicalExpr):
return or_, (EXPR_GETTER_ID,)
- [as(classmethod)]
+ [dispatch_as(classmethod)]
def immediate(klass,seq):
for item in seq:
if item:
@@ -260,7 +260,7 @@ class AndExpr(LogicalExpr):
return and_, (EXPR_GETTER_ID,)
- [as(classmethod)]
+ [dispatch_as(classmethod)]
def immediate(klass,seq):
for item in seq:
if not item:
@@ -278,7 +278,7 @@ class IfElse(LogicalExpr):
return get(argIds[2])
return ifelse, (EXPR_GETTER_ID,)
- [as(classmethod)]
+ [dispatch_as(classmethod)]
def immediate(klass,seq):
if seq[1]: return seq[0]
return seq[2]