Commit 8e6ce1cc by Marten Ringwelski

get_dirs_in_dir: Invert logic

parent 967ec218
...@@ -152,8 +152,7 @@ def get_dirs_in_dir(directory_path: Union[str, Path]) -> List[str]: ...@@ -152,8 +152,7 @@ def get_dirs_in_dir(directory_path: Union[str, Path]) -> List[str]:
try: try:
path = Path(directory_path) path = Path(directory_path)
for item in path.iterdir(): for item in path.iterdir():
if not Path(item).is_dir(): if Path(item).is_dir():
continue
result.append(str(item.resolve())) result.append(str(item.resolve()))
except Exception as exc: except Exception as exc:
logging.error(f'Could not get directories: {exc}', exc_info=True) logging.error(f'Could not get directories: {exc}', exc_info=True)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment