Skip to content

Commit

Permalink
src/__init__.py: cope with mupdf wrapper classes having operator bool.
Browse files Browse the repository at this point in the history
This broke test_pagedelete.py::test_deletion.
  • Loading branch information
julian-smith-artifex-com committed Jan 5, 2024
1 parent 7849e55 commit 62cc377
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20840,6 +20840,7 @@ def retainpages(doc, liste):
olddests = mupdf.pdf_load_name_tree(doc, PDF_NAME('Dests'))
outlines = mupdf.pdf_dict_get(oldroot, PDF_NAME('Outlines'))
ocproperties = mupdf.pdf_dict_get(oldroot, PDF_NAME('OCProperties'))
names_list = None

root = mupdf.pdf_new_dict(doc, 3)
mupdf.pdf_dict_put(root, PDF_NAME('Type'), mupdf.pdf_dict_get(oldroot, PDF_NAME('Type')))
Expand Down Expand Up @@ -20954,7 +20955,7 @@ def sRGB_to_rgb(srgb: int) -> tuple:


def string_in_names_list(p, names_list):
n = mupdf.pdf_array_len( names_list)
n = mupdf.pdf_array_len( names_list) if names_list else 0
str_ = mupdf.pdf_to_text_string( p)
for i in range(0, n, 2):
if mupdf.pdf_to_text_string( mupdf.pdf_array_get( names_list, i)) == str_:
Expand Down

0 comments on commit 62cc377

Please sign in to comment.