summaryrefslogtreecommitdiff
path: root/ATRI/utils/file.py
diff options
context:
space:
mode:
Diffstat (limited to 'ATRI/utils/file.py')
-rw-r--r--ATRI/utils/file.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/ATRI/utils/file.py b/ATRI/utils/file.py
index 2cf03df..a873647 100644
--- a/ATRI/utils/file.py
+++ b/ATRI/utils/file.py
@@ -2,22 +2,22 @@ import aiofiles
import urllib
from pathlib import Path
-from ATRI.exceptions import RequestTimeOut, WriteError
+from ATRI.exceptions import WriteError
from .request import get_content
-async def write_file(path: Path, text, encoding="utf-8") -> None:
+async def write_file(path: Path, text, encoding='utf-8') -> None:
try:
- async with aiofiles.open(path, "w", encoding=encoding) as target:
+ async with aiofiles.open(path, 'w', encoding=encoding) as target:
await target.write(text)
except WriteError:
raise WriteError("Writing file failed!")
-async def open_file(path: Path, method, encoding="utf-8"):
+async def open_file(path: Path, method, encoding='utf-8'):
try:
- async with aiofiles.open(path, "r", encoding=encoding) as target:
+ async with aiofiles.open(path, 'r', encoding=encoding) as target:
if method == "read":
return target.read()
elif method == "readlines":