Skip to content

Commit 32db673

Browse files
authored
Fix attribute access. (#36)
1 parent a5a7edc commit 32db673

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ all releases are available on `Anaconda.org
1212

1313
- :pull:`32` implements a new interface to the compilation process which consists of
1414
composable compilation steps. (Many thanks to :user:`axtimhaus`!:tada:)
15+
- :pull:`36` fixes some issues.
1516

1617

1718
0.1.1 - 2022-02-08

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,11 @@ compilation step. It is equivalent to the following.
160160

161161
.. code-block::
162162
163-
from pytask_latex import compilation_steps
163+
from pytask_latex import compilation_steps as cs
164164
165165
166166
@pytask.mark.latex(
167-
compilation_steps=compilation_steps.latexmk(
167+
compilation_steps=cs.latexmk(
168168
options=("--pdf", "--interaction=nonstopmode", "--synctex=1", "--cd")
169169
)
170170
)

src/pytask_latex/collect.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ def task_func():
3131
3232
to
3333
34-
from pytask_latex import compilation_steps
34+
from pytask_latex import compilation_steps as cs
3535
36-
@pytask.mark.latex(compilation_steps.latexmk(options))
36+
@pytask.mark.latex(compilation_steps=cs.latexmk(options))
3737
def task_func():
3838
...
3939
@@ -67,8 +67,9 @@ def latex(
6767
out = []
6868
for step in to_list(compilation_steps):
6969
if isinstance(step, str):
70-
parsed_step = getattr(cs, step)
71-
if parsed_step is None:
70+
try:
71+
parsed_step = getattr(cs, step)
72+
except AttributeError:
7273
raise ValueError(f"Compilation step {step!r} is unknown.")
7374
out.append(parsed_step())
7475
elif callable(step):

0 commit comments

Comments
 (0)