Session._collect: use reversed parts

This commit is contained in:
Daniel Hahler 2018-11-09 01:36:20 +01:00
parent a0890f98d8
commit 560c055b09
1 changed files with 2 additions and 2 deletions

View File

@ -495,9 +495,9 @@ class Session(nodes.FSCollector):
# No point in finding packages when collecting doctests
if not self.config.option.doctestmodules:
pm = self.config.pluginmanager
for parent in argpath.parts():
for parent in reversed(argpath.parts()):
if pm._confcutdir and pm._confcutdir.relto(parent):
continue
break
if parent.isdir():
pkginit = parent.join("__init__.py")