1
0
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:
Badiboy 2023-01-07 13:02:26 +03:00 committed by GitHub
commit d5bbaa900e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@ class StatePickleStorage(StateStorageBase):
""" """
Create directory .save-handlers. 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) os.makedirs(dirs, exist_ok=True)
if not os.path.isfile(self.file_path): if not os.path.isfile(self.file_path):
with open(self.file_path,'wb') as file: with open(self.file_path,'wb') as file:

View File

@ -34,7 +34,7 @@ class StatePickleStorage(StateStorageBase):
""" """
Create directory .save-handlers. 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) os.makedirs(dirs, exist_ok=True)
if not os.path.isfile(self.file_path): if not os.path.isfile(self.file_path):
with open(self.file_path,'wb') as file: with open(self.file_path,'wb') as file: