1
0
mirror of https://github.com/instaloader/instaloader.git synced 2024-09-11 16:22:24 +02:00

Don't fail if --sessionfile does not contain '/'

This commit is contained in:
Alexander Graf 2017-03-21 14:58:13 +01:00
parent 0a039b9c8c
commit 72c647829a

View File

@ -284,7 +284,7 @@ def save_session(session: requests.Session, username: str, filename: Optional[st
if filename is None:
filename = get_default_session_filename(username)
dirname = os.path.dirname(filename)
if not os.path.exists(dirname):
if dirname != '' and not os.path.exists(dirname):
os.makedirs(dirname)
os.chmod(dirname, 0o700)
with open(filename, 'wb') as sessionfile: