[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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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