Skip to content

Commit

Permalink
Merge pull request #1134 from akrabat/fix-test-failures
Browse files Browse the repository at this point in the history
Fix test failures
  • Loading branch information
lornajane committed Mar 19, 2023
2 parents 51aeb2a + d36ef4e commit f7f4ea6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
10 changes: 7 additions & 3 deletions rst2pdf/createpdf.py
Expand Up @@ -200,7 +200,10 @@ def __init__(
self.font_path = font_path
self.style_path = style_path
self.def_dpi = def_dpi
self.record_dependencies = DependencyList(record_dependencies)
if record_dependencies is not None:
self.record_dependencies = DependencyList(record_dependencies)
else:
self.record_dependencies = None
self.loadStyles(stylesheets)

self.docutils_languages = {}
Expand Down Expand Up @@ -568,8 +571,9 @@ def createPdf(
else:
self.doctree = doctree

for dep in self.doctree.settings.record_dependencies.list:
self.record_dependencies.add(dep)
if self.record_dependencies is not None:
for dep in self.doctree.settings.record_dependencies.list:
self.record_dependencies.add(dep)

if self.numbered_links:
# Transform all links to sections so they show numbers
Expand Down
3 changes: 2 additions & 1 deletion rst2pdf/utils.py
Expand Up @@ -406,5 +406,6 @@ def __init__(self, *args, record_dependencies=None, **kwargs):

def get_source(self, environment, template):
r = (_, path, _) = super().get_source(environment, template)
self.record_dependencies.add(path)
if self.record_dependencies is not None:
self.record_dependencies.add(path)
return r
Binary file modified tests/reference/test_stylesheet_includes.pdf
Binary file not shown.

0 comments on commit f7f4ea6

Please sign in to comment.