Skip to content

Commit 95c3a6a

Browse files
committed
MNT: pre-filter tocheck
1 parent 86a6021 commit 95c3a6a

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

_websiteutils/make_redirects_links.py

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,28 @@
2626
branch and pushed as a PR so it can easily be reverted.
2727
"""
2828

29-
_log = logging.getLogger('make_redirect_links')
30-
31-
32-
tocheck = ['stable'] + [f'{major}.{minor}.{micro}'
33-
for major in range(6, -1, -1)
34-
for minor in range(6, -1, -1)
35-
for micro in range(6, -1, -1)]
36-
37-
toignore = tocheck + ['mpl-probscale', 'mpl_examples', 'mpl_toolkits',
38-
'_webpageutils', 'xkcd', 'sitemap.xml',
39-
'robots.txt', 'CNAME', '.git']
29+
_log = logging.getLogger("make_redirect_links")
30+
31+
32+
tocheck = ["stable"] + [
33+
f"{major}.{minor}.{micro}"
34+
for major in range(6, -1, -1)
35+
for minor in range(6, -1, -1)
36+
for micro in range(6, -1, -1)
37+
if pathlib.Path(f"{major}.{minor}.{micro}").exists()
38+
]
39+
40+
toignore = tocheck + [
41+
"mpl-probscale",
42+
"mpl_examples",
43+
"mpl_toolkits",
44+
"_webpageutils",
45+
"xkcd",
46+
"sitemap.xml",
47+
"robots.txt",
48+
"CNAME",
49+
".git",
50+
]
4051

4152
logging.basicConfig(level=logging.DEBUG)
4253

0 commit comments

Comments
 (0)