Skip to content

Commit cbf6726

Browse files
authored
Made docbuild errors easier to debug + fixed error from changed exception class (ManimCommunity#3229)
* Make errors during docbuild somewhat easier to debug * fix an issue with docbuild under py3.10+
1 parent b9367a2 commit cbf6726

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

manim/utils/docbuild/manim_directive.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,13 @@ def run(self):
272272
f"{clsname}().render()",
273273
]
274274

275-
with tempconfig(example_config):
276-
run_time = timeit(lambda: exec("\n".join(code), globals()), number=1)
277-
video_dir = config.get_dir("video_dir")
278-
images_dir = config.get_dir("images_dir")
275+
try:
276+
with tempconfig(example_config):
277+
run_time = timeit(lambda: exec("\n".join(code), globals()), number=1)
278+
video_dir = config.get_dir("video_dir")
279+
images_dir = config.get_dir("images_dir")
280+
except Exception as e:
281+
raise RuntimeError(f"Error while rendering example {clsname}") from e
279282

280283
_write_rendering_stats(
281284
clsname,

manim/utils/hashing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def default(self, obj: Any):
207207
del cvardict[i]
208208
try:
209209
code = inspect.getsource(obj)
210-
except OSError:
210+
except (OSError, TypeError):
211211
# This happens when rendering videos included in the documentation
212212
# within doctests and should be replaced by a solution avoiding
213213
# hash collision (due to the same, empty, code strings) at some point.

0 commit comments

Comments
 (0)