Changeset 1135

Show
Ignore:
Timestamp:
08/22/08 14:49:46
Author:
seang
Message:

Raise exception properly in the case of a non-sequence bounds argument (#169).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Rtree/trunk/rtree/_rtreemodule.cc

    r1057 r1135  
    124124 
    125125    bounds = PySequence_Fast(binput, "Bounds must be a sequence"); 
     126    if (bounds == NULL) return NULL; 
     127 
    126128    size = (int) PySequence_Fast_GET_SIZE(bounds); 
    127129     
  • Rtree/trunk/tests/BoundsCheck.txt

    r933 r1135  
    1919  ValueError: Bounding box is invalid: maxx < miny or maxy < miny 
    2020 
     21Adding with invalid bounds argument should raise an exception 
    2122 
     23  >>> index.add(1, 1) 
     24  Traceback (most recent call last): 
     25  ... 
     26  TypeError: Bounds must be a sequence