| 42 | } |
| 43 | |
| 44 | bool is_zip_file(const nb::module_& zipfile, const nb::object& file) { |
| 45 | if (is_istream_object(file)) { |
| 46 | auto st_pos = file.attr("tell")(); |
| 47 | bool r = nb::cast<bool>(zipfile.attr("is_zipfile")(file)); |
| 48 | file.attr("seek")(st_pos, 0); |
| 49 | return r; |
| 50 | } |
| 51 | return nb::cast<bool>(zipfile.attr("is_zipfile")(file)); |
| 52 | } |
| 53 | |
| 54 | class ZipFileWrapper { |
| 55 | public: |
no test coverage detected