Skip to content

Commit 474673b

Browse files
committed
Exclude some modules that aren't shipped (pypi#35)
1 parent acd7126 commit 474673b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

stdlib_list/fetch.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010
list_dir = os.path.join(base_dir, "lists")
1111

12+
EXCLUDE_RE = re.compile(
13+
r'(ctypes\.test|distutils\.tests|test\.|json\.re|lib\.libpython)'
14+
)
15+
1216

1317
class DummyConfig(object):
1418
def __init__(self, intersphinx_mapping=None, intersphinx_cache_limit=5, intersphinx_timeout=None):
@@ -65,9 +69,8 @@ def fetch_list(version=None):
6569
url = "http://docs.python.org/{}/objects.inv".format(version)
6670

6771
modules = sorted(
68-
list(
69-
fetch_inventory(DummyApp(), "", url).get("py:module").keys()
70-
)
72+
x for x in fetch_inventory(DummyApp(), "", url).get("py:module").keys()
73+
if not EXCLUDE_RE.match(x)
7174
)
7275

7376
with open(os.path.join(list_dir, "{}.txt".format(version)), "w") as f:

0 commit comments

Comments
 (0)