Skip to content

Commit

Permalink
python: Fix subtle bug that lost certain string args (#2587)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgritz committed May 24, 2020
1 parent f161d93 commit 5937c5a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/python/py_oiio.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,9 @@ py_to_stdvector(std::vector<T>& vals, const py::object& obj)
if (py::isinstance<py::list>(obj)) { // if it's a Python list
return py_indexable_pod_to_stdvector(vals, obj.cast<py::list>());
}
if (py::isinstance<py::buffer>(obj)) {
// Apparently a str can masquerade as a buffer object, so make sure to
// exclude that from teh buffer case.
if (py::isinstance<py::buffer>(obj) && ! py::isinstance<py::str>(obj)) {
return py_buffer_to_stdvector(vals, obj.cast<py::buffer>());
}

Expand Down

0 comments on commit 5937c5a

Please sign in to comment.