Use PurePath instead of Path

Path should only be used when we need to access the file system. For all other
purposes (mainly crawling), we use PurePath instead since the paths don't
correspond to paths in the local file system.
This commit is contained in:
Joscha
2021-04-29 16:52:00 +02:00
parent 0096d83387
commit f776186480
3 changed files with 21 additions and 20 deletions

View File

@ -1,6 +1,6 @@
import asyncio
import random
from pathlib import Path
from pathlib import PurePath
from typing import Any
from rich.markup import escape
@ -37,9 +37,9 @@ DUMMY_TREE = {
class DummyCrawler(Crawler):
async def crawl(self) -> None:
await self._crawl_entry(Path(), DUMMY_TREE)
await self._crawl_entry(PurePath(), DUMMY_TREE)
async def _crawl_entry(self, path: Path, value: Any) -> None:
async def _crawl_entry(self, path: PurePath, value: Any) -> None:
if value is True:
async with self.exclusive_output():
await ainput(f"File {path}, please press enter: ")