8000 FIX: Fix stability of stored compiled regex (#1369) · sphinx-gallery/sphinx-gallery@3fce549 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3fce549

Browse files
authored
FIX: Fix stability of stored compiled regex (#1369)
1 parent 7078993 commit 3fce549

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

sphinx_gallery/gen_gallery.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,11 @@ def _update_gallery_conf_exclude_implicit_doc(gallery_conf):
159159
160160
This is separate function for better testability.
161161
"""
162-
# prepare regex for exclusions from implicit documentation
162+
# prepare regex for exclusions from implicit documentation, ensuring that what
163+
# gets complied has a stable __repr__ (i.e., by sorting the exclude_implicit_doc
164+
# set before joining)
163165
exclude_regex = (
164-
re.compile("|".join(gallery_conf["exclude_implicit_doc"]))
166+
re.compile("|".join(sorted(gallery_conf["exclude_implicit_doc"])))
165167
if gallery_conf["exclude_implicit_doc"]
166168
else False
167169
)

sphinx_gallery/gen_rst.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1347,7 +1347,7 @@ def generate_file_rst(fname, target_dir, src_dir, gallery_conf):
13471347
script_blocks, script_vars, gallery_conf, file_conf
13481348
)
13491349

1350-
logger.debug("%s ran in : %.2g seconds\n", src_file, time_elapsed)
1350+
logger.debug("%s ran in : %.2g seconds", src_file, time_elapsed)
13511351

13521352
# Create dummy images
13531353
_make_dummy_images(executable, file_conf, script_vars)

0 commit comments

Comments
 (0)
0