[CogManagerUI] Fix error when removing path from other OS (#4466)

* Fix error when removing path from other OS

* Update to draper's comment
This commit is contained in:
Neuro Assassin
2020-12-17 22:15:59 -05:00
committed by GitHub
parent 3a12a9b47f
commit 92788a90c1

View File

@@ -127,11 +127,7 @@ class CogManager:
pathlib.Path
"""
try:
path.exists()
except AttributeError:
path = Path(path)
return path
return Path(path)
async def add_path(self, path: Union[Path, str]) -> None:
"""Add a cog path to current list.
@@ -177,7 +173,7 @@ class CogManager:
Path to remove.
"""
path = self._ensure_path_obj(path).resolve()
path = self._ensure_path_obj(path)
paths = await self.user_defined_paths()
paths.remove(path)