I'm not sure what possessed me when I last touched this, but to get
the path relative to the kernel/ directory we have to strip of the
first 5 parts, not just 1.
if include:
regex = re.compile("|".join(include))
for m in modules:
- rel = os.fspath(Path(*m.parts[1:]))
+ rel = os.fspath(Path(*m.parts[5:]))
if regex.search(rel):
keep.add(rel)
remove = set()
regex = re.compile("|".join(exclude))
for m in modules:
- rel = os.fspath(Path(*m.parts[1:]))
+ rel = os.fspath(Path(*m.parts[5:]))
if rel not in keep and regex.search(rel):
remove.add(m)