Skip to content
Snippets Groups Projects
Unverified Commit 3cd203f5 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

build fix

parent 86bebd74
No related branches found
No related tags found
No related merge requests found
Pipeline #61304 canceled with stage
in 35 seconds
......@@ -6,6 +6,14 @@ snakehouse.
import typing as tp
def _has_separator(path: str) -> bool:
# handle Windows case
if len(path) == 3:
if path.endswith(':/') or path.endswith(':\\'):
return False
return any(map(lambda x: x in path, SEPARATORS))
def find_files(path: str, wildcard: str = r'(.*)',
prefix_with: tp.Optional[str] = None,
scan_subdirectories: bool = True,
......@@ -57,9 +65,20 @@ def split(path: str) -> tp.List[str]:
Is is true that
>>> os.path.join(split(a)) == a
"""
data = list(os.path.split(path))
while _has_separdef split(path: str) -> tp.List[str]:
"""
An exact reverse of os.path.join
Is is true that
>>> os.path.join(split(a)) == a
"""
data = list(os.path.split(path))
while _has_separator(data[0]):
data = list(os.path.split(data[0])) + data[1:]
return dataator(data[0]):
data = list(os.path.split(data[0])) + data[1:]
return data
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment