Skip to content
Snippets Groups Projects
Commit b8014edd authored by Andreas Dedner's avatar Andreas Dedner
Browse files

some change in python3.9 or newer numpy introduces a '<Q' buffer_info.format

identifier. Extend identification in bindings
parent aecd6048
Branches
Tags
1 merge request!1081some change in python3.9 or newer numpy introduces a '<Q' buffer_info.format identifier
Pipeline #42512 passed
Pipeline: Dune Nightly Test

#42513

    ......@@ -28,9 +28,12 @@ inline bool already_registered() {
    template <class F>
    inline void handle_buffer_format(const pybind11::buffer_info &info, F &&f) {
    if(info.format.size() != 1)
    if(info.format.size() > 2)
    throw std::runtime_error("Buffer format '" + info.format + "' not supported.");
    switch(info.format[0]) {
    char format = info.format[0];
    if(format == '=' || format == '<')
    format = info.format[1];
    switch(format) {
    case 'h':
    return f(format_descriptor<short>());
    case 'H':
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment