Skip to content

Commit 4931103

Browse files
committed
Fix syntax error, move dict because copilot nitpick.
1 parent 2488afe commit 4931103

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

docs/functions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ Yet others are handy, general-purpose utilities.
763763
try:
764764
return sum([widthlist[ord(c)] for c in text]) * fontsize
765765
except IndexError:
766-
raise ValueError:(f"max. code point found: {ord(max(text))}, increase limit")
766+
raise ValueError(f"max. code point found: {ord(max(text))}, increase limit")
767767

768768
-----
769769

src/utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,6 +1619,7 @@ def set_toc(
16191619
# ------------------------------------------------------------------------------
16201620
# now create each outline item as a string and insert it in the PDF
16211621
# ------------------------------------------------------------------------------
1622+
name_key_pairs = {"first": "First", "last": "Last", "next": "Next", "parent": "Parent", "prev": "Prev"}
16221623
for i, ol in enumerate(olitems):
16231624
txt = "<<"
16241625
if ol["count"] != 0:
@@ -1629,7 +1630,6 @@ def set_toc(
16291630
# Verbose in PyMuPDF/tests.
16301631
if g_exceptions_verbose >= 2: pymupdf.exception_info()
16311632
pass
1632-
name_key_pairs = {"first": "First", "last": "Last", "next": "Next", "parent": "Parent", "prev": "Prev"}
16331633
for name, pdf_key in name_key_pairs.items():
16341634
try:
16351635
if ol[name] > -1:
@@ -1638,7 +1638,6 @@ def set_toc(
16381638
if g_exceptions_verbose >= 2:
16391639
pymupdf.exception_info()
16401640
pass
1641-
16421641
try:
16431642
txt += "/Title" + ol["title"]
16441643
except Exception:

0 commit comments

Comments
 (0)