mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-01 05:45:45 +00:00
- Unbreak
- Fix build error Approved by: portmgr (pav)
This commit is contained in:
parent
c49629b054
commit
dd9ce2ffcf
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=220342
@ -18,8 +18,6 @@ COMMENT= A fast tree with ordered data and expanded iterator support
|
||||
|
||||
BUILD_DEPENDS= pyrexc:${PORTSDIR}/devel/pyrex
|
||||
|
||||
BROKEN= does not compile
|
||||
|
||||
USE_PYTHON= yes
|
||||
USE_PYDISTUTILS= easy_install
|
||||
PYEASYINSTALL_ARCHDEP= yes
|
||||
|
@ -1,11 +1,11 @@
|
||||
--- ./src/rbtree.pyx.orig Sat Feb 10 06:49:24 2007
|
||||
+++ ./src/rbtree.pyx Mon Mar 26 10:19:44 2007
|
||||
--- src/rbtree.pyx.orig 2007-02-10 06:49:24.000000000 +0800
|
||||
+++ src/rbtree.pyx 2008-09-09 16:52:56.000000000 +0800
|
||||
@@ -83,7 +83,7 @@
|
||||
cdef int _done
|
||||
cdef iter_direction _direction
|
||||
|
||||
- def __new__(self, RBTree tree, int itype):
|
||||
+ def __new__(self, RBTree tree, itype):
|
||||
+ def __cinit__(self, RBTree tree, itype):
|
||||
self._T = tree
|
||||
self._iter = NULL
|
||||
self._type = itype
|
||||
@ -18,3 +18,68 @@
|
||||
self._direction = value
|
||||
|
||||
cdef _position(self, iter_direction direction):
|
||||
@@ -193,7 +193,7 @@
|
||||
cdef class RBTree:
|
||||
cdef rbtree_t *_tree
|
||||
|
||||
- def __new__(self, mapping=None, cmp=None):
|
||||
+ def __cinit__(self, mapping=None, cmp=None):
|
||||
self._tree = rbtree_alloc()
|
||||
rbtree_init(self._tree)
|
||||
|
||||
@@ -245,7 +245,7 @@
|
||||
def __setitem__(self, key, value):
|
||||
# calling hash on the key verifies that its not
|
||||
# mutilble, as far as a dict would anyway...
|
||||
- if isinstance(key, slice):
|
||||
+ if isinstance(key, key_slice):
|
||||
raise ValueError, "setslice is unsupported"
|
||||
|
||||
hash(key)
|
||||
@@ -254,7 +254,7 @@
|
||||
def __getitem__(self, key):
|
||||
cdef void * v
|
||||
|
||||
- if isinstance(key, slice):
|
||||
+ if isinstance(key, key_slice):
|
||||
return self.__doslice__(key)
|
||||
|
||||
v = rbtree_get(self._tree, key)
|
||||
@@ -264,7 +264,7 @@
|
||||
def __delitem__(self, key):
|
||||
cdef int rc
|
||||
|
||||
- if isinstance(key, slice):
|
||||
+ if isinstance(key, key_slice):
|
||||
self.__dodeleteslice__(key)
|
||||
return
|
||||
|
||||
@@ -272,7 +272,7 @@
|
||||
if rc != 0: raise KeyError, key
|
||||
|
||||
|
||||
- def __doslice__(self, slice):
|
||||
+ def __doslice__(self, key_slice):
|
||||
# This is our hacked up version that getattr will invoke with
|
||||
# a slice object. We support key ordering so we could have
|
||||
# interger offsets into the results, but really we want to
|
||||
@@ -280,14 +280,14 @@
|
||||
# values between a->z. A new rbtree is returned
|
||||
instance = self.__class__()
|
||||
rbtree_do_slice(self._tree,
|
||||
- slice.start,
|
||||
- slice.stop,
|
||||
- slice.step,
|
||||
+ key_slice.start,
|
||||
+ key_slice.stop,
|
||||
+ key_slice.step,
|
||||
(<RBTree>instance)._tree)
|
||||
return instance
|
||||
|
||||
- def __dodeleteslice__(self, slice):
|
||||
- rbtree_do_del_slice(self._tree, slice.start, slice.stop, slice.step)
|
||||
+ def __dodeleteslice__(self, key_slice):
|
||||
+ rbtree_do_del_slice(self._tree, key_slice.start, key_slice.stop, key_slice.step)
|
||||
|
||||
def get(self, key, default=None):
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user