mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-29 08:32:02 +00:00
Merge pull request #32 from polygon/fix_complex_arrays
Fixed py:array constructor from failing for complex types
This commit is contained in:
commit
3e4263447b
@ -96,7 +96,7 @@ public:
|
|||||||
|
|
||||||
array(const buffer_info &info) {
|
array(const buffer_info &info) {
|
||||||
API& api = lookup_api();
|
API& api = lookup_api();
|
||||||
if (info.format.size() != 1)
|
if ((info.format.size() < 1) || (info.format.size() > 2))
|
||||||
throw std::runtime_error("Unsupported buffer format!");
|
throw std::runtime_error("Unsupported buffer format!");
|
||||||
int fmt = (int) info.format[0];
|
int fmt = (int) info.format[0];
|
||||||
if (info.format == "Zd")
|
if (info.format == "Zd")
|
||||||
|
Loading…
Reference in New Issue
Block a user