Skip to content
  • David Gobbi's avatar
    BUG 16054: Reduce chance of mistaken swig pointer string. · 66c211a7
    David Gobbi authored
    In the Python wrappers, the vtkDataArray::SetVoidArray() method can take
    two kinds of arguments:
    
    1) a string formatted as a swig pointer "_addr_type" where "addr" is
    the hexadecimal address and "type" is the type, e.g. "p_void".
    
    2) a Python buffer object (any Python object with buffer protocol)
    
    A Python string (in Python 2) is also a buffer object, therefore there
    is some ambiguity.  The use of swig pointers with VTK is exceedingly
    rare, so this fix requires that the string exactly matches the format
    "_addr_p_void" to be interpreted as a swig pointer.
    
    Note that in Python 3, the ambiguity disappears because a string in Py3K
    does not have the buffer protocol.
    66c211a7