Skip to content

Commit 6569e24

Browse files
Create parent directories for configuration.
1 parent ac419e1 commit 6569e24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ptpython/entry_points/run_ptpython.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"""
1818
import argparse
1919
import os
20+
import pathlib
2021
import sys
2122
from typing import Tuple
2223

@@ -66,8 +67,7 @@ def get_config_and_history_file(namespace: argparse.Namespace) -> Tuple[str, str
6667

6768
# Create directories.
6869
for d in (config_dir, data_dir):
69-
if not os.path.isdir(d) and not os.path.islink(d):
70-
os.mkdir(d)
70+
pathlib.Path(d).mkdir(parents=True, exist_ok=True)
7171

7272
# Determine config file to be used.
7373
config_file = os.path.join(config_dir, "config.py")

0 commit comments

Comments
 (0)