From 12734323f40f45ff2d94f72395af3ca00fb2ab7f Mon Sep 17 00:00:00 2001 From: Colin Leitner Date: Sun, 6 Apr 2014 15:37:25 +0200 Subject: [PATCH] Fixed an expression which led to a KeyError for internal links. --- weasyprint/pdf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weasyprint/pdf.py b/weasyprint/pdf.py index 42468fe4..e8d92d91 100644 --- a/weasyprint/pdf.py +++ b/weasyprint/pdf.py @@ -595,7 +595,7 @@ def write_pdf_metadata(document, fileobj, scale, metadata, url_fetcher=None): content = [pdf_format('<< /Type /Annot ' '/Rect [{0:f} {1:f} {2:f} {3:f}] /Border [0 0 0]\n', *rectangle)] - if is_internal != 'attachment' and not annot_files[target] is None: + if is_internal != 'attachment' or annot_files[target] is None: content.append(b'/Subtype /Link ') if is_internal == 'internal': content.append(pdf_format(