Skip to content
Snippets Groups Projects
Commit 66c211a7 authored by David Gobbi's avatar David Gobbi
Browse files

BUG 16054: Reduce chance of mistaken swig pointer string.

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.
parent 5efcd8d2
Branches
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment