[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
eea8bab283
commit
e5aacc6ac9
|
@ -69,27 +69,27 @@ def iterparentnodeids(nodeid: str) -> Iterator[str]:
|
||||||
# The root Session node - always present.
|
# The root Session node - always present.
|
||||||
yield ""
|
yield ""
|
||||||
|
|
||||||
if nodeid == '':
|
if nodeid == "":
|
||||||
return
|
return
|
||||||
|
|
||||||
if nodeid.startswith('::'):
|
if nodeid.startswith("::"):
|
||||||
# Weird case of '::x' (no path)
|
# Weird case of '::x' (no path)
|
||||||
yield nodeid
|
yield nodeid
|
||||||
return
|
return
|
||||||
|
|
||||||
path, sep, node = nodeid.partition('::')
|
path, sep, node = nodeid.partition("::")
|
||||||
|
|
||||||
sections = path.split(SEP)
|
sections = path.split(SEP)
|
||||||
for i, _ in enumerate(sections, start=1):
|
for i, _ in enumerate(sections, start=1):
|
||||||
yield SEP.join(sections[:i])
|
yield SEP.join(sections[:i])
|
||||||
|
|
||||||
if sep == '':
|
if sep == "":
|
||||||
# Only a path
|
# Only a path
|
||||||
return
|
return
|
||||||
|
|
||||||
nodes = node.split('::')
|
nodes = node.split("::")
|
||||||
for i, _ in enumerate(nodes, start=1):
|
for i, _ in enumerate(nodes, start=1):
|
||||||
yield '::'.join([path] + nodes[:i])
|
yield "::".join([path] + nodes[:i])
|
||||||
|
|
||||||
|
|
||||||
def _check_path(path: Path, fspath: LEGACY_PATH) -> None:
|
def _check_path(path: Path, fspath: LEGACY_PATH) -> None:
|
||||||
|
|
Loading…
Reference in New Issue