mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-07 15:34:52 +00:00
Update save_file to accept pathlib objects (#469)
This commit is contained in:
parent
ce0ddcddb2
commit
faab2f451c
1 changed files with 2 additions and 2 deletions
|
|
@ -27,7 +27,7 @@ import tempfile
|
||||||
from configparser import ConfigParser
|
from configparser import ConfigParser
|
||||||
from hashlib import sha256, md5
|
from hashlib import sha256, md5
|
||||||
from importlib import import_module
|
from importlib import import_module
|
||||||
from pathlib import Path
|
from pathlib import Path, Pureapath
|
||||||
from signal import signal, SIGINT, SIGTERM, SIGABRT
|
from signal import signal, SIGINT, SIGTERM, SIGABRT
|
||||||
from typing import Union, List, BinaryIO
|
from typing import Union, List, BinaryIO
|
||||||
|
|
||||||
|
|
@ -1804,7 +1804,7 @@ class Client(Methods, BaseClient):
|
||||||
|
|
||||||
part_size = 512 * 1024
|
part_size = 512 * 1024
|
||||||
|
|
||||||
if isinstance(path, str):
|
if isinstance(path, (str, PurePath)):
|
||||||
fp = open(path, "rb")
|
fp = open(path, "rb")
|
||||||
elif isinstance(path, io.IOBase):
|
elif isinstance(path, io.IOBase):
|
||||||
fp = path
|
fp = path
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue