mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Merge pull request #1870 from Cub11k/master
Make create_dir() method of StatePickleStorage cross-platform instead of POSIX only.
This commit is contained in:
commit
d5bbaa900e
@ -28,7 +28,7 @@ class StatePickleStorage(StateStorageBase):
|
||||
"""
|
||||
Create directory .save-handlers.
|
||||
"""
|
||||
dirs = self.file_path.rsplit('/', maxsplit=1)[0]
|
||||
dirs, filename = os.path.split(self.file_path)
|
||||
os.makedirs(dirs, exist_ok=True)
|
||||
if not os.path.isfile(self.file_path):
|
||||
with open(self.file_path,'wb') as file:
|
||||
|
@ -34,7 +34,7 @@ class StatePickleStorage(StateStorageBase):
|
||||
"""
|
||||
Create directory .save-handlers.
|
||||
"""
|
||||
dirs = self.file_path.rsplit('/', maxsplit=1)[0]
|
||||
dirs, filename = os.path.split(self.file_path)
|
||||
os.makedirs(dirs, exist_ok=True)
|
||||
if not os.path.isfile(self.file_path):
|
||||
with open(self.file_path,'wb') as file:
|
||||
|
Loading…
Reference in New Issue
Block a user